cPanel and LVE

Requirements for cPanel 

  1. LVE installed (use centos2cl script available here)
  2. Apache 2.2.x or 1.3.x, compiled with easyapache
  3. mod_suexec should be enabled
  4. Apache should be configured with MPM Prefork, Worker or Event
  5. wget and yum should be installed

Important: httpd.conf doesn't change often in CPanel. Most of the changes that are done via cPanel GUI go into php.conf, pre_virtualhost_*.conf, post_virtualhost_*.conf. The httpd.conf is usually changed only during Apache re-compile. If there is a need to do changes in httpd.conf:http://twiki.cpanel.net/twiki/bin/view/EasyApache3/OutsideVHost in httpd.conf (not recommended) look at additional recommendations

Installing CloudLinux enhancements 

This instruction will work if you are running any of the following:
  • mod_php
  • mod_suPHP
  • mod_fcgid
  • MPM Worker
  • MPM Event
  • MPM Prefork
  • mod_cgi
  • mod_cgid
The script will automatically detect what you are running, and will add appropriate components.

Install script is accessible via http://repo.cloudlinux.com/cloudlinux/sources/install-lve
Script - install-lve - has following options:

-h - help message
-l - install mod_hostinglimits only
-m - install mod_hostinglimits hook
-r - rebuild httpd.conf (cPanel)
-e - clear all LVE related changes from EasyApache, rebuild apache to get back to no LVE setup
-f - force installation
-d - enable debug messages
-q - quiet install without info from commands yum,rpm,wget
-c - install mod_fcgid module
-k - install mod_fcgid hook
-a - install mod_hostinglimits, mod_fcgid, rebuld httpd.conf

Parameter f cannot be given by itself. It has do be given in addition to other parameters. By default, install script does soft install. That means that if module or package is already installed, script will not re-install it. Script will only install missing components. In case where -f(force) parameter is present - script will re-install everything

Parameter -d is needed for verbose mode.

Examples: 

Install everything in quiet mode, if component already install -- skip installation of the component.
install-lve -adq
Install everything in quiet mode. Re-install mod_hostinglimits and mod_fcgid, if it is already installed
install-lve -adqf
Quiet install
install-lve -af

Installing CloudLinux for the first time: 

Execute as root:
  1. install-lve -a

That will install mod_hostinglimits and setup a hook for cPanel, so that it would be re-compiled when apache is updated

Modules that will be installed according to Apache configuration:

  1. mod_hodtinglimits - Apache 2.2.x or 1.3.x, MPM Prefork
  2. mod_fcgid - Apache 2.2, MPM Prefork, Worker or Event
  3. mod_cgid - Apache 2.2, MPM Worker
Apache 1.3Apache 2.2 MPM PreforkApache 2.2 MPM Worker or Event
mod_hostinglimits mod_hostinglimitsmod_hostinglimits
mod_cgid
mod_fcgidmod_fcgid

Source tarballs :
  1. http://repo.cloudlinux.com/cloudlinux/sources/mod_hostinglimits.tar.gz
  2. http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid.tar.gz

If durring the install of the script, cmake will not be located on the system, it will be installed by the script as well.

Additional config files:
  1. http://repo.cloudlinux.com/cloudlinux/confs/modhostinglimits.conf
  2. and hook files named as hook#.conf
  3. http://repo.cloudlinux.com/cloudlinux/confs/mod_fcgid.conf

Changes introduces by install script 

Script tries to minimise changes to the system

  • Install apache modules from sources, and install config templates.
  • module mod_hostinglimits.so - /usr/local/apache/modules/ (/etc/httpd/modules/) (optional)
  • module configuration modhostinglimits.conf - /usr/local/apache/conf/conf.d/ (/etc/httpd/conf/conf.d/) (optional)
  • hook for CPanel before_httpd_restart_tests - /scripts/
  • Modified templates:
  • template for httpd.conf - main.default - /var/cpanel/templates/apache2/ (Added line Include "/usr/local/apache/conf/conf.d/*")

Additional recommendations

To remove changes added by install script, remove from templates that mentioned above, and execute:

/scripts/rebuildhttpdconf


Additional links 

  1. http://twiki.cpanel.net/twiki/bin/view/DevHooks/ScriptHooks
  2. http://twiki.cpanel.net/twiki/bin/view/AllDocumentation/ScriptHooks
  3. http://template-toolkit.org/docs/manual/index.html

Installing cPanel

To install cPanel on fresh CloudLinux installation, you will need to alter /etc/redhat-release file so that cPanel recognizes what to install. In the future we are hoping that cPanel will detect CloudLinux natively.

# echo "CentOS release 5.5 (Final)" > /etc/redhat-release
After that follow cPanel instructions.


Alternatively you can do:
# wget http://repo.cloudlinux.com/cloudlinux/sources/install-cpanel
# sh install-cpanel

That script will alter /etc/redhat-release file, and it will start cPanel installation.