Pages

Tuesday, 17 December 2013

How to fix /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

This will happen only on 64 bit systems, the cause is the fact that 32 bit libraries are missing from the system, so you can easily fix this issue by installing the 32 bit libraries on your system. So if you encounter this error /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory this is how you can fix it:
On any RPM based distribution (CentOS/RedHat/Fedora/Suse/Mandriva):
yum -y install glibc.i686
 
On any DEB based distribution (Debian/Ubuntu/Mint/Crunchbang):
apt-get update
apt-get install ia32-libs

Tuesday, 16 April 2013

Fork : Cannot allocate memory(VPS Server)

In a VPS server, this usually occurs when VPS is running out of resources especially RAM. By restarting the VPS you can fix the issue. But it would be a temporary fix and it will only allow you to login to the server, but cannot execute some of the commands.
Check for the failcnt value of privvmpages and kmemsize variables. Due to the increase in failcnt, you are receiving the error “fork:Cannot allocate memory”.  Please check /proc/user_beancounters on vps for checking the failcount.

$ cat /proc/user_beancounters
uid      resource         held        maxheld    barrier    limit    failcnt
privvmpages               33656     44989       96550       96550    106507

You can increase the limit by editing the following file in the main node.

$ /etc/sysconfig/vz-scripts/<ve-node>.conf

You can see the value as below
PRIVVMPAGES=”96550:96550″

Increase the value as you need and then restart the vps.
Another method to increase the limit is using command as follows:

$ vzctl set <ve_node> –privvmpages 12752512:12752512 –save

You will now be able to restart cpanel and it will be working fine.

Sunday, 17 March 2013

How to fixed error bad ELF interpreter

I got the following error:
/usr/local/lsws/bin/lswsctrl: ./litespeed: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
[ERROR] Failed to start litespeed!

While was fixed by typing
yum install ld-linux.so.2

Then after that installed type
/usr/local/lsws/bin/lswsctrl start

Tuesday, 23 October 2012

cPanel CloudLinux Installation/Uninstallation

Cloud Linux greatly increases the stability of a shared hosting environment through it’s resource limit feature that prevents sudden resource spikes from taking down the entire server.
By using CloudLinux you can define the max CPU, Memory, Concurrent Connections and Number of Cores Per LVE .

Cloud Linux Installation ::

Below are the few simple steps to complete the installation ::
root@server[#] wget http://repo.cloudlinux.com/cloudlinux/sources/cln/cpanel2cl

root@server[#] sh cpanel2cl -k <activation_key>


root@server[#] reboot


root@server[#] /scripts/easyapache --build


root@server[#] yum install cpanel-lve -y


root@server[#] yum install cpanel-lvemanager -y


root@server[#] yum install lve-cpanel-plugin -y


Installing and Configuring mod_hostinglimits if not already loaded with default installation

root@server[#] wget http://repo.cloudlinux.com/cloudlinux/sources/mod_hostinglimits.tar.gz

root@server[#] tar -zxvf mod_hostinglimits.tar.gz


root@server[#] cd mod_hostinglimits


root@server[#] cmake CMakeLists.txt


root@server[#] make install


And then add the below line in the httpd.conf to load the mod_hostinglimits module in Apache

LoadModule hostinglimits_module modules/mod_hostinglimits.so

Cloud Linux Uninstallation ::


Follow the below steps to uninstall CloudLinux safely ::

Before proceeding to un-installation of CloudLinux , check if your server has CloudLinux installed

/usr/local/cpanel/bin/cloudlinux_system_install -c

1 > Update your CentOS-provided RPMs
root@server[#] yum upgrade -y

2 > Recompile Apache and prevent linking to liblve
root@server[#] /scripts/easyapache --build

3 > Re-install your Non-CloudLinux Kernel
root@server[#] yum --disableexcludes=all install kernel

4 > Remove CloudLinux Kernel
root@server[#] rpm -qa |awk '/^kernel.*lve/ {print $1|"xargs yum -y erase"}'

5 > Reinstall any CloudLinux-provided RPMs that are also provided by CentOS
root@server[#] rpm -qa --qf "[%{VENDOR} %{NAME}\n]"|awk '/CloudLinux/ {print $2|"xargs yum reinstall -y"}'

6 > Downgrade any CloudLinux provided RPMs to the CentOS version
root@server[#] rpm -qa --qf "[%{VENDOR} %{NAME}\n]"|awk '/CloudLinux/ {print $2|"xargs yum downgrade -y"}'

7 > Remove any remaining CloudLinux specific RPMs
rpm -qa --qf "[%{VENDOR} %{NAME}\n]"|awk '/CloudLinux/ {print $2|"xargs yum erase -y"}'

8 > Upgrade any downgraded CentOS provided RPMs
root@server[#] yum upgrade -y

9 > Reboot the server to use the new non-CloudLinux kernel
root@server[#] reboot






Saturday, 30 June 2012

cpsrvd not running

If Cpanel is not running on the server and you are getting following,

# service cpanel status

cpsrvd dead but pid file exists
entropychat is stopped
melange is stopped
stunnel is stopped
interchange is stopped
qrunner is stopped

Then if you try to restart cpsrvd and if you are getting following error,

# /usr/local/cpanel/cpsrvd restart

Cwd object version 3.11 does not match $Cwd::VERSION 3.14

Then please try running following to fix the problem,

rm -rf /usr/local/cpanel/modules-install/pro-* (kill old version of pro modulres)
echo -n > /var/cpanel/addonmoduleversions/pro
/scripts/upcp --force

This will fix the problem and Cpanel will start working again.

Tuesday, 26 June 2012

CPanel Proxy - WHM Proxy Domain

What is CPanel Proxy Support?

CPanel proxy support allows you to access both the domain.com/cpanel and domain.com/webmail as subdomains. Additionally the normal CPanel ports for both the control panel and webmail are proxied through port 80. There are quite a few firewalls that block 2082, 2083 et. cetra as they are not standard ports.

The following once enabled should work:
http://cpanel.domain.com
http://webmail.domain.com
http://whm.domain.com

Requirements
CPanel
mod_rewrite
mod_proxy

How to enable CPanel Proxy

1. Open the WHM and access tweak settings:

Main >> Server Configuration >> Tweak Settings

2. Enable the following options:

Add proxy VirtualHost to httpd.conf to automatically redirect unconfigured cpanel, webmail, webdisk and whm subdomains to the correct port (requires mod_rewrite and mod_proxy)

Automatically create cpanel, webmail, webdisk and whm proxy subdomain DNS entries for new accounts. When this is initially enabled it will add appropriate proxy
subdomain DNS entries to all existing accounts. (Use /scripts/proxydomains to reconfigure the DNS entries manually)


This will setup all new accounts with the proper records; existing ones will need to be added via the /scripts/proxydomains script.

I would recommend disabling this one as you probably don’t want a client to break the setup for their domain trying to fix it:

Allow users to create cpanel, webmail, webdisk and whm subdomains that override automatically generated proxy subdomains

3. For existing accounts open a shell prompt as root. All you need to do now is to setup the sub-domains so that customers can access them. The best way to do this is to specify the username:
Example:
/scripts/proxydomains --user=username add
Usage:
/scripts/proxydomains --user=mycpaneluser add
To do all accounts on the server (which can take a while):
/scripts/proxydomains add
To list all the options for this script simply type
/scripts/proxydomains 

4. Add this to httpd.conf

# CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS
<VirtualHost xx.xx.xx:80 *>
    ServerName $hostname
    ServerAlias cpanel.* whm.* webmail.* webdisk.*
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin system@hostname
    <IfModule mod_security2.c>
        SecRuleEngine Off
    </IfModule>
    UserDir disable
    RewriteEngine On
    <IfModule core.c>
        SSLProxyEngine On
    </IfModule>
    RewriteCond %{HTTP_HOST} ^cpanel\.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2083/$1 [P]
    RewriteCond %{HTTP_HOST} ^webmail\.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]
    RewriteCond %{HTTP_HOST} ^whm\.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2087/$1 [P]
    RewriteCond %{HTTP_HOST} ^webdisk\.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2078/$1 [P]
    RewriteCond %{HTTP_HOST} ^cpanel\.
    RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P]
    RewriteCond %{HTTP_HOST} ^webmail\.
    RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P]
    RewriteCond %{HTTP_HOST} ^whm\.
    RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P]
    RewriteCond %{HTTP_HOST} ^webdisk\.
    RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P]
    UseCanonicalName Off
</VirtualHost> 

Saturday, 16 June 2012

How to upgrade MySQL 5.0 to MySQL 5.1 cPanel

How to upgrade MySQL 5.0 to MySQL 5.1 in a cPanel server
Login as root and edit /var/cpanel/cpanel.config.
Replace :
mysql-version=5.0 with
mysql-version=5.1
Finally run: /scripts/mysqlup