Posts tagged Installing and Configuring mod_hostinglimits on cPanel

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 .




 Concurrent Connections:

 Number of Cores Per LVE*:
 *requires server reboot for existing LVEs

And through above  options CloudLinux isolates each user so that no matter what, the user can never exceed the resources allocated to him.


Cloud Linux Installation ::

Cloud Linux installation is simple and a  cPanel  server must meet the below requirements ::


    LVE installed
    Apache 2.2.x or 1.3.x, compiled with easyapache
    mod_suexec should be enabled
    Apache should be configured with MPM Prefork, Worker or Event
    wget and yum should be installed

Below are the few simple steps to complete  the installation ::


root@server[#] wget
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[#] cd /usr/local/src
root@server[#] wget
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/

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


That’s all.