Category Archives: Linux tutorials

Here you can find the tutorials for linux Os

log bytes error: apache can not start

Issue :-

When I restart Apache, it throws the following error.

/usr/local/apache/libexec/mod_log_bytes.so into server: /usr/local/apache/libexec/mod_log_bytes.so: cannot open shared object file: No such file or directory
Oct 13 07:47:48 web rc: Starting httpd: failed

Invalid command ‘BytesLog’, perhaps mis-spelled or defined by a module not included in the server configuration

Reason
The problem with this kind of symptom is most likely due to the cause that the mod_belimited.so, mod_log_bytes.so, or mod_bandwidth.so are deleted or corrupted. These 3 files are unique to cPanel-powered web hosting service and are used to control, monitor or restrict the bandwidth usage limit.

Fix
The resolution and solution to the error is to recompile and redeploy the missing or unable to find shared library modules. You can easily compile these cPanel modules for Apache by using the following commands:

cd /usr/local/cpanel/apache
/usr/local/apache/bin/apxs -iac mod_log_bytes.c
/usr/local/apache/bin/apxs -iac mod_bwlimited.c
/usr/local/apache/bin/apxs -iac mod_bandwidth.c

After compilation, the .so files will automatically copied to libexec directory for Apache HTTPD web server.

Advertisements

postgres ERROR: role “username” does not exist

Issue 1

When I am trying to create Postgre DB using Cpanel, I get the following error:

Error from postgres wrapper: PostgreSQL has not been configured by the administrator. Unable to locate pgpass file.

Fix 1
You need to install a Postgres authentication configuration file that uses md5 passwords which works with cPanel. You can do this through WHM.

Login to WHM >> SQL Services >> Postgres Config >> Click on “Install Config”.

Issue 2
Okie  now I can create databases with new accounts. But already created accounts have  issues. It says  database created but it actually not creates and shows the following error in cPanel logs

tail -f /usr/local/cpanel/logs/error_log

ERROR:  role “username” does not exist
ERROR:  role “username” does not exist

Fix 2

Login to the server as “root” and execute the following command.

cd /var/cpanel/users && for x in *; do su -c “createuser -S -D -R $x” postgres; done

Proftpd error: fatal: Socket operation on non-socket

Error

root@hostname [~]# /etc/init.d/proftpd restart
Stopping proftpd: [FAILED]
Starting proftpd: hostname.domainname.com – fatal: Socket operation on non-socket
[FAILED]

Reason


The ProFtpd was configured to run in “inetd” mode. In “inetd” mode, ProFTPD expects that it will be run from the inetd super-server, which implies that stdin/stdout will be sockets instead of terminals. As a result, socket operations will fail.

root@hostname [~]# grep ServerType /etc/proftpd.conf

ServerType                      inetd

root@hostname [~]#

Fix

Edit the proftpd configuration and  change the ServerType to “standalone” mode and restarted ProFtpd.


root@hostname [~]# grep ServerType /etc/proftpd.conf
ServerType                      standalone
#ServerType                      inetd
root@hostname [~]#    /etc/init.d/proftpd restart
Stopping proftpd:                                          [FAILED]
Starting proftpd:                                          [  OK  ]

For more details : http://www.proftpd.org/docs/faq/linked/faq-ch4.html

How to switch Plesk control panel from IIS to Apache?

How to switch Plesk control panel from one webserver to another?

Launch command prompt.

Start >> Run >> cmd
If IIS is used as Plesk web server switch it to Apache

%plesk_bin%\reconfigurator.exe –switch-plesk-web-server –new-provider=apache

If Apache is used as Plesk web server switch it to IIS

%plesk_bin%\reconfigurator.exe –switch-plesk-web-server –new-provider=iis

ASP.NET , IIS and 32 bit emulation mode in 64 bit server

How to switch between the 32-bit versions of ASP.NET and the 64-bit version of ASP.NET on a 64-bit version of Windows?

IIS 6.0 supports both the 32-bit mode and the 64-bit mode. However IIS 6.0 does not support running both modes at the same time on a 64-bit version of Windows. ASP.NET 1.1 runs only in 32-bit mode. ASP.NET 2.0 runs in 32-bit mode or in 64-bit mode. Therefore, if you want to run ASP.NET 1.1 and ASP.NET 2.0 at the same time, you must run IIS in 32-bit mode.

ASP.NET 1.1, 32-bit version

// To run the 32-bit version of ASP.NET 1.1, follow these steps:

  1. Click Start, click Run, type cmd, and then click OK.
  2. Type the following command to enable the 32-bit mode:
    cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
  3. Type the following command to install the version of ASP.NET 1.1 and to install the script maps at the IIS root and under:
    %SYSTEMROOT%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i
  4. Make sure that the status of ASP.NET version 1.1.4322 is set to Allowed in the Web service extension list in Internet Information Services Manager.

ASP.NET 2.0, 32-bit version

// To run the 32-bit version of ASP.NET 2.0, follow these steps:

  1. Click Start, click Run, type cmd, and then click OK.
  2. Type the following command to enable the 32-bit mode:
    cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
  3. Type the following command to install the version of ASP.NET 2.0 (32-bit) and to install the script maps at the IIS root and under:
    %SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
  4. Make sure that the status of ASP.NET version 2.0.50727 (32-bit) is set to Allowed in the Web service extension list in Internet Information Services Manager.

ASP.NET 2.0, 64-bit version

// To run the 64-bit version of ASP.NET 2.0, follow these steps:

  1. Click Start, click Run, type cmd, and then click OK.
  2. Type the following command to disable the 32-bit mode:
    cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0
  3. Type the following command to install the version of ASP.NET 2.0 and to install the script maps at the IIS root and under:
    %SYSTEMROOT%\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -i
  4. Make sure that the status of ASP.NET version 2.0.50727 is set to Allowed in the Web service extension list in Internet Information Services Manager.

Ref : http://support.microsoft.com/kb/894435

Certificate for exim will expire in 30 days

ISSUE :-

I received 4 emails with following subjects.


Certificate for courier-imapd on hostname.domainname will expire in less then 30 days
Certificate for cpanel on hostname.domainname will expire in less then 30 days
Certificate for exim on hostname.domainname will expire in less then 30 days
Certificate for courier-pop3d on hostname.domainname will expire in less then 30 days

The contents in all of the emails is

Certificate for courier-imapd on hostname.domainname will expire in less then 30 days. You should install a new certifcate as soon as possible. You can install a new certificate in WHM under “Manager Service SSL Certificates”, or by clicking this link: https://hostname.domainname:2087/scripts2/manageservicecrts

Fix :-

Exim or the mail server uses self signed certificates for its services and is valid for one year. You need to renew the certificate in every year. You can renew the certificates from WHM as follows.

WHM login >> Main >> Service Configuration >> Manage Service SSL Certificates >> Reset Certificate