Installation

Hardware compatibility

CloudLinux supports all the hardware supported by RHEL/CentOS 6.x, with few exceptions. Exceptions are usually hardware that require binary drivers, and that doesn't have any open source alternatives.

At this moment we are aware of only one such case:

Device Binary Driver Source
B110i Smart Array RAID controller hpahcisr http://h10032.www1.hp.com/ctg/Manual/c01754456
B120i/B320i Smart Array SATA RAID Controller hpvsa http://www8.hp.com/h20195/v2/GetPDF.aspx/c04168333.pdf
SanDisk DAS Cache http://www.dell.com/en-us/work/learn/server-technology-components-caching

Converting existing servers

It is easy to switch server from CentOS 6.x or 7.x to CloudLinux. The process takes a few minutes and replaces just a handful of RPMs.

If you have activation key:

$ wget https://repo.cloudlinux.com/cloudlinux/sources/cln/cldeploy
$ sh cldeploy -k <activation_key>

If you have IP-based license:

$ sh cldeploy -i
$ reboot

Once you have rebooted, you are running CloudLinux kernel with LVE enabled.

The script automatically detects and supports the following control panels:

  • cPanel with EA4 (EA3 till September 1st.)
  • Plesk
  • DirectAdmin
  • InterWorx.

It will install CloudLinux kernel, Apache module, PAM module, command line tools as well as LVE Manager.

ISPmanager 5 has native support for CloudLinux. To deploy CloudLinux on a server with ISPmanager 5, you would need to purchase CloudLinux license directly from ISPSystems and follow ISPmanager's deployment guide.

See also advanced options for cldeploy

Note

We normally recommend to install lvemanager, lve-utils, lve-stats, and cagefs packages after installing a control panel.
But when you deploy CloudLinux from the ISO image, these packages will be preinstalled. You can reinstall them after installing the control panel.

Explanation of changes

CloudLinux uses the fact that it is very close to CentOS and RHEL to convert systems in place, requiring just one reboot. Our conversion script does the following actions:

  • Backups the original repository settings into /etc/cl-convert-saved.
  • Backups RHEL system ID into /etc/cl-convert-saved (RHEL systems only).
  • Installs CL repository settings & imports CL RPM key.
  • Replaces redhat/centos-release, redhat-release-notes, redhat-logos with CL version.
  • Removes cpuspeed RPM (as it conflicts with CPU limits).
  • Re-installs CL version of rhnlib/rhnplugin.
  • Checks for binary kernel modules, finds replacement if needed.
  • Detects OVH servers and fixes mkinitrd issues.
  • Detects Linode servers and fixes grub issues.
  • Checks if LES is installed.
  • Checks that /etc/fstab has correct /dev/root
  • Checks for efi.
  • Installs CL kernel, lve-utils, liblve, lve-stats RPMs.
  • Installs LVE Manager for cPanel, Plesk, DirectAdmin, ISPManager & InterWorx
  • Installs mod_hostinglimits apache module:
    • RPM install for Plesk, ISPManager & InterWorx;
    • On Plesk, replaces psa-mod_fcgid* with mod_fcgid;
    • custombuild for DirectAdmin.

Script for converting back:

  • Restores CentOS repositories, and centos-release/release-notes/logos.
  • Removes lve, mod_hostinglimits, lve-stats, lvemanager.
  • mod_hostinglimits RPM is removed.

The kernel is not removed - to prevent condition when server has no kernels and wouldn't boot. The command line to remove the kernel is provided.

On cPanel servers, rebuild of Apache with EasyApache will complete the conversion back, but doesn't have to be performed immediately.

On DirectAdmin servers, rebuild of Apache with custombuild will complete the conversion back, but doesn't have to be performed immediately.

Common issues and troubleshooting during conversion

Issue Solution
Double registration issue with the error: Maximum usage count of 1 reached If you want to use the license on another server or reuse it on the same server after reinstalling, you need to remove the server from CLN and then register the license on your new server. You may use the following page for a reference to remove the server from CLN: https://docs.cln.cloudlinux.com/index.html?servers.htm Please don't remove the license, remove only the server.

Activation

Getting trial license

You will need a trial activation key to be able to convert your CentOS server to CloudLinux. The trial subscription will work for 30 days.

If you have any issues getting activation key or if you have any questions regarding using your trial subscription – contact sales@cloudlinux.com and we will help.

To get the activation key:

  1. Register with CloudLinux Network: https://cln.cloudlinux.com/console/register/customer (skip it if you already registered)
  2. You will receive an email with activation link
  3. Login at https://cln.cloudlinux.com/console/auth/login
  4. Click on Get Trial Activation Key

You will get a key that looks like: 12314-d34463a182fede4f4d7e140f1841bcf2

Use it to register your system or to convert CentOS server to CloudLinux server.

License activation

To register your server with CloudLinux Network using activation key run:

$ yum install rhn-setup --enablerepo=cloudlinux-base
$ /usr/sbin/rhnreg_ks --force --activationkey=<activation key>

Where activation key is like 1231-2b48feedf5b5a0e0609ae028d9275c93

If you have IP based license, use clnreg_ks command:

$ yum install rhn-setup --enablerepo=cloudlinux-base
$ /usr/sbin/clnreg_ks --force

Installing new servers

You can download the latest CloudLinux ISO and use it to install CloudLinux on your server:

Note

Once you install server from the ISO, make sure you register your system and then run yum update.

Note

We recommend to reinstall lvemanager, lve-utils, lve-stats, and cagefs packages after installing a control panel.

CloudLinux OS images

Xen images

To start using Xen image:

  • Decompress xen image to: /var/lib/xen/images/ (depends on your setup)
  • Create a config file in /etc/xen

Like:

name = "cl6-sample"
uuid = "4230bccf-5882-2ac6-7e1c-0e2a60208001"
maxmem = 1024
memory = 1024
vcpus = 1
bootloader = "/usr/bin/pygrub"
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
vfb = [ "type=vnc,vncunused=1,key=en-us" ]
disk = [ "tap:aio:/var/lib/xen/images/cl6-sample.img,sda,w" ]
vif = [ "mac=00:16:3e:23:09:10,bridge=xenbr0,script=vif-bridge" ]

where:

  • name = "cl6-sample" - a unique name of the server
  • disk = [ "tap:aio:/var/lib/xen/images/cl6-sample.img,sda,w" ] - path to image file
  • uuid = "4230bccf-5882-2ac6-7e1c-0e2a60208001" - a unique id for that server
  • vif = [ "mac=00:16:3e:23:09:10,bridge=xenbr0,script=vif-bridge" ] - unique MAC
  • [maxmem = 1024 memory = 1024 vcpus = 1] – resources

Root password: cloudlinux

Disk Images

Net install

To install CloudLinux over network:

  1. Download & boot from netboot image from: https://repo.cloudlinux.com/cloudlinux/6.10/iso/x86_64/CloudLinux-6.10-x86_64-netinstall.iso. It will boot into CloudLinux installer.

    Alternatively you can configure your PXE server using following folder as reference: https://repo.cloudlinux.com/cloudlinux/6.10/install/x86_64/images/pxeboot/

  2. During the CloudLinux installation, select URL as installation source and enter URL: http://repo.cloudlinux.com/cloudlinux/6.10/install/x86_64/ and continue with installation.

To install CloudLinux 5.11 instead of 6.10 use the following URL: http://repo.cloudlinux.com/cloudlinux/5.11/netinstall/x86_64/

Same URLs can be used to install para-virtualized Xen using either command-line or virt manager.

Provider-specific guidelines

H-Sphere

Note

For H-Sphere 3.5+

Please note, that CageFS and PHP Selector are not supported for H-Sphere

Requirements

  1. CloudLinux with liblve 0.8 or later.
  2. Apache 2.2.x or 1.3.
  3. mod_suexec should be enabled.

To achieve optimal performance, we recommend to convert from mod_fastcgi to mod_fcgid.

There is no need to install mod_hostinglimits – it comes built in with H-Sphere. Once you load kernel from CloudLinux with liblve 0.8 or later – it will get enabled.

You can check if LVE is enabled by running:

$ ps aux | grep httpd | grep DLIBLVE

If you see no output, it means that Apache didn't pick up LVE. Try checking file /hsphere/shared/scripts/apache-get-env.sh

The following lines should be there:

if [ -e /usr/lib64/liblve.so.0 -o -e /usr/lib/liblve.so.0 ]; then
APENV_DSSL="$APENV_DSSL -DLIBLVE"
fi

If those strings are absent, you should add it, after:

else
APENV_DSSL='-DSSL'
fi
###

and before:

# this is used by apacheGetEnv.pm perl module
if [ "$1" = 'show' ] ; then
set | egrep "^APENV_"
fi

strings.

Restart Apache afterward.

Converting from mod_fastcgi to mod_fcgid

To achieve the best results in productivity and stability we recommend converting from mod_fastcgi to mod_fcgid.

Note

H-Sphere 3.6.3+

  1. Download our fcgi.conf file:
$ wget -O /hsphere/local/config/httpd2/fcgi.conf http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/fcgi.conf
  1. Edit ~httpd2/conf/extra/httpd-hostinglimits.conf to the following state:
######
LoadModule hostinglimits_module /hsphere/shared/apache2/modules/mod_hostinglimits.so

<IfModule mod_hostinglimits.c>
SkipErrors Off
AllowedHandlers cgi-script %php% fcgid-script application/x-miva-compiled
DenyHandlers hs-php5-script hs-php53-script hs-php54-script
Include /hsphere/local/config/httpd2/fcgi.conf
 
</IfModule>
#######
  1. Go to P.Servers > web server [Config] and be sure to have enabled:
    • apache_version=2
    • apache_mpm=prefork
    • apache_fastcgi
    • apache_fcgid
    • PHP version/mode: php_fastcgi*

Note

*No changes needed to httpd.conf.tmpl.custom or usermodule.phpmode as this version provides its own mod_fcgid.

Older versions of H-Sphere

  1. Compile mod_fcgid module:
$ yum install gcc liblve-devel zlib-devel openssl-devel 
$ wget http://apache.osuosl.org//httpd/mod_fcgid/mod_fcgid-2.3.9.tar.gz
$ tar zxvf mod_fcgid-2.3.9.tar.gz
$ cd mod_fcgid-2.3.9/
$ APXS=/hsphere/shared/apache2/bin/apxs ./configure.apxs 
$ make
$ mv modules/fcgid/.libs/mod_fcgid.so /hsphere/shared/apache2/modules
  1. Download and apply patch http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/usemodule.phpmode.patch to /hsphere/local/config/scripts/usemodule.phpmode:
$ wget http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/usemodule.phpmode.patch 
$ patch /hsphere/local/config/scripts/usemodule.phpmode usemodule.phpmode.patch
  1. If /hsphere/local/config/httpd2/httpd.conf.tmpl.custom does not exists – create it:
$ cp -rp /hsphere/local/config/httpd2/httpd.conf.tmpl /hsphere/local/config/httpd2/httpd.conf.tmpl.custom

Download and apply patch http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/httpd.conf.tmpl.patch to the /hsphere/local/config/httpd2/httpd.conf.tmpl.custom:

$ wget http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/httpd.conf.tmpl.patch 
$ patch --fuzz=3 /hsphere/local/config/httpd2/httpd.conf.tmpl.cusom  httpd.conf.tmpl.patch
  1. Download pre-defined config file http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/fcgi.conf to /hsphere/local/config/httpd2:
$ wget -O /hsphere/local/config/httpd2/fcgi.conf http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/fcgi.conf
  1. Download our wrapper file http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/php-wrapper into /hsphere/shared/php5/bin/ and make it executable:
$ wget -O /hsphere/shared/php5/bin/php-wrapper http://repo.cloudlinux.com/cloudlinux/sources/mod_fcgid-hsphere/php-wrapper
$ chmod 755 /hsphere/shared/php5/bin/php-wrapper
  1. Change permissions for /hsphere/local/home to 755:
$ chmod 755 /hsphere/local/home
  1. Edit ~httpd2/conf/extra/httpd-hostinglimits.conf and add DenyHandlers, so section will look like:
<IfModule mod_hostinglimits.c>
SkipErrors Off
AllowedHandlers cgi-script %php% fcgid-script application/x-miva-compiled
DenyHandlers hs-php5-script hs-php53-script hs-php54-script 
</IfModule>
  1. Configure physical server from H-Sphere admin > E.Manager > P.Servers > server_name [parameters] icon, settings should be:
apache_version = 2
apacha_fastcgi = yes
apache_status = yes

  1. Set PHP configuration to:
php_libphp5 enabled but not default
php_fastcgi5 enabled and is default

Other options could be configured according to personal needs.

When done - click SUBMIT to apply changes.

Note

After updating H-Sphere software on web server with CloudLinux you need to re-apply step 2 (patch usemodule.phpmode) and restart apache with /hsphere/shared/scripts/apache-restart script.

DigitalOcean

How to make CloudLinux work on DigitalOcean:

DigitalOcean doesn't support custom kernels. The droplet (VM) always runs DigitalOcean's kernel. CloudLinux requires its own kernel. To enable CloudLinux work on DigitalOcean droplets, we provide ability to boot into CloudLinux kernel using kexec functionality.

How does this work:

  • cldeploy script checks for presence of /etc/digitalocean. If the file detected, we assume that this is DigitalOcean droplet;
  • kexec-tools are installed;
  • kexec script will be created in /etc/rc.d/init.d/ and set to run right after rc.sysinit.

When executed, script /etc/rc.d/init.d/kexec detects the latest installed CloudLinux kernel, and loads that kernel.

If the system cannot boot into CloudLinux kernel (due to any reason), subsequent reboot will skip kexec, allow droplet to boot into DigitalOceans' kernel.

To disable booting into Cloudlinux kernel, run:

chkconfig --del kexec

To re-enable booting into CloudLinux kernel, run:

chkconfig --add kexec

Adding CloudLinux OS image to DigitalOcean

Custom images are Linux distributions that have been modified to fit the specific needs of DigitalOcean users. You can find some basics of importing a custom CloudLinux OS image below.

Importing custom images to DigitalOcean is free, as you are only charged for the storage of your image. To save money, you can easily import your image, start a Droplet from your image, and delete the image, so you don’t incur any storage costs.

Below, we will describe how to add a qcow2 (QEMU/KVM) CloudLinux OS image as a custom image. You can find more information on image options at https://www.digitalocean.com/docs/images/custom-images/overview/

  1. To choose the right image, navigate to https://download.cloudlinux.com/cloudlinux/images/#kvm-tab. Several different images are available for download (with and without a control panel).

  1. Copy the link for the image you are going to use and log into cloud.digitalocean.com.

Click Images on the left of the screen and then choose Custom Images. Click the Import via URL button and paste the CloudLinux OS image link.

There are several options here, but the most important is Choose a datacenter region, i.e. which datacenter region your Droplets should be created in for this image.

Click the Upload Image button and wait until the image is successfully uploaded.

  1. Add your public key to access your droplets using key-based authentication: navigate to the Security sidebar menu and click the Add SSH Key button.

You can find more information about creating/adding SSH keys in this article.

  1. You will then be able to start a CloudLinux OS Droplet using the image.

    Note

    Your Droplet will be created in the same datacenter that your custom image resides in.

  1. Now, use your preferred SSH client software to connect to your Droplet. You can find more information on SSH client setup here.

Linode

CloudLinux on Linode KVM

To install CloudLinux 7 on Linode KVM server you should perform the following steps:

  1. Deploy CL to your Linode following the steps from this section

  2. Install grub on your system:

yum install grub2
  1. Add to /etc/default/grub the following parameters:
GRUB_TIMEOUT=10
GRUB_CMDLINE_LINUX="console=ttyS0,19200n8"
GRUB_DISABLE_LINUX_UUID=true
GRUB_SERIAL_COMMAND="serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1"
  1. Update grub config:
grub2-mkconfig -o /boot/grub/grub.cfg
  1. Edit your Linode profile, change the boot settings to GRUB 2 .

  2. Reboot your Linode.

After reboot you will have fully operational CloudLinux 7 system and can proceed with other configuration you need.

CloudLinux on Linode Xen

To install CloudLinux 7 on Linode Xen please perform the following steps:

  1. Deploy CL to your Linode following the steps from this section.

  2. Create the file /boot/grub/menu.lst with the following content:

timeout 5
title CloudLinux 7.1, $KVERSION
root (hd0)
kernel /boot/vmlinuz-$KVERSION root=/dev/xvda ro quiet
initrd /boot/initramfs-$KVERSION.img

where $KVERSION is the version of the installed CloudLinux 7 kernel.

Note

You will need to update /boot/grub/menu.lst manually after every kernel update.

  1. Switch boot settings to pv-grub-x86_64 and switch off Auto-configure networking in Linode settings.

  2. Reboot your Linode.

In case if you will migrate to KVM later you will need only switch the boot settings to GRUB 2.

Virtuozzo and OpenVZ

Note

We’ll be ending support for Virtuozzo and OpenVZ containers on November 1st, 2019. If you are running Virtuozzo and OpenVZ, you will still be able to use CloudLinux OS but you will need to run hypervisors. See detail on how to run hypervisors here.

Note

  • Virtuozzo 6 and OpenVZ 6 are supported.
  • Virtuozzo 7 and OpenVZ 7 are not supported.

Note

Kernel 2.6.32-042stab088.4 or later required

CloudLinux provides limited support for OpenVZ and Virtuozzo. At this stage only the following functionality works:

  • CageFS
  • PHP Selector
  • max entry processes
  • mod_lsapi
  • MySQL Governor

No other limits work so far.

Installation

VZ Node (needs to be done once for the server):

Note

Make sure all containers are stopped prior to doing this operation. Or reboot the server after the install.

Note

Please make sure you have vzkernel-headers and vzkernel-devel packages installed. If no - install them with yum

yum install vzkernel-headers vzkernel-devel

$ wget -P /etc/yum.repos.d/ http://repo.cloudlinux.com/vzlve/vzlve.repo
$ yum install lve-kernel-module

This will setup LVE module for VZ kernel, as well as DKMS to update that module each time VZ kernel is updated.

After this is done, you can add LVE support for any container on a node, at any time.

To make CloudLinux work inside VZ container, VZ node has to be enabled. This should be done for any container where LVE support needs to be added:

$ vzctl set CT_ID --devnodes lve:rw --save

To disable LVE support for Container:

$ vzctl set CT_ID --devnodes lve:none --save

Inside container, follow standard CloudLinux installation procedures.

CloudLinux license is required for each VZ container.

Note

Some servers require increasing fs.ve-mount-nr on host node, otherwise CageFS will throw errors.

To increase fs.ve-mount-nr, on a host node:

  1. add fs.ve-mount-nr = 15000 to /etc/sysctl.conf;

  2. apply it with sysctl -p command.

In very rare cases the value should be increased higher, up to 50000.

LILO boot loader

CloudLinux can be deployed on servers that don't have grub installed, by installing хороgrub first.

To do that:

  1. Make sure grub and kernel packages are not excluded. Edit file /etc/yum.conf and check exclude= line for presence of kernel* grub*.

  2. Backup lilo config file:

mv /etc/lilo.conf /etc/lilo.conf.bak
  1. Convert to CloudLinux using deploy2cl utility.

  2. Check grub.conf – it should be configured automatically:

# cat /boot/grub/grub.conf
default=0
timeout=5
title CloudLinux Server (2.6.18-294.8.1.el5.lve0.7.33)
     kernel /boot/vmlinuz-2.6.18-294.8.1.el5.lve0.7.33 root=/dev/sda1  ro
     root (hd0,0)
     initrd /boot/initrd-2.6.18-294.8.1.el5.lve0.7.33.img
     title linux centos5_64
     kernel /boot/bzImage-2.6.33.5-xxxx-grs-ipv4-64 root=/dev/sda1  ro
     root (hd0,0)
  1. Install grub to master boot record:
/sbin/grub-install /dev/sda
  1. Reboot and check that you are running CloudLinux. uname -r should show something like: 2.6.18-294.8.1.el5.lve0.7.33.

Uninstalling

You can always uninstall CloudLinux. In this case, we will 'convert' the system back to CentOS. Even if the original system was RHEL - we will still convert to CentOS state.

The following actions will be taken:

  1. LVE related packages will be removed.
  2. CloudLinux repositories & yum plugin will be removed.
  3. CentOS repositories will be setup.

At the end, the script will provide instructions on how to finish the conversion back to CentOS. That will require removal of CloudLinux kernel (manual step), and installation of CentOS kernel (if needed).

To uninstall CloudLinux, do:

$ wget -O cldeploy https://repo.cloudlinux.com/cloudlinux/sources/cln/cldeploy
$ sh cldeploy -c

Now you have converted back to CentOS and it is the time to install kernel.

To delete CloudLinux kernel, run:

rpm -e --nodeps kernel-2.6.32-673.26.1.lve1.4.27.el6.x86_64

To install new CentOS kernel once you deleted CloudLinux kernel, type yum install kernel.

If yum says that the latest kernel is already installed, it is OK.

Please check your bootloader configuration before rebooting the system.

To remove unused kmods and lve libs run:

yum remove lve kmod*lve*

Kernel package and related LVE packages should be deleted and the required kernel will be installed.

Before the reboot, the following command should be executed for restoring Apache and httpd.conf without mod_hostinglimits:

For EasyApache 3:

/scripts/easyapache --build

For EasyApache 4:

/usr/local/bin/ea_install_profile --install /etc/cpanel/ea4/profiles/cpanel/default.json

Note

Some of the packages from CloudLinux repo will still be present. They are the same as CentOS packages, and don't have to be removed. They will be updated in the future from CentOS repositories, as new versions come out.

Migration to EasyApache 4

Advices and limitations

  • Use cPanel 11.55.999.66(55.999.66) or higher version.
  • Hardened EA4 limitations:
    • ea-php51 and ea-php52 have no PHP-FPM support. Please use mod_lsapi instead.

Follow the instructions here to install and configure mod_lsapi.

CentOS with EeasyApache 4

If EasyApache 4 was installed earlier on your CentOS server and you would like to migrate to CloudLinux:

  1. Convert server from CentOS 6.x or 7.x to CloudLinux (see these instructions).

  2. Restart Apache service.

CentOS without EasyApache 4

If EasyApache 4 was not installed earlier on your CentOS server and you would like to migrate to CloudLinux:

  1. Convert server from CentOS 6.x or 7.x to CloudLinux (see these instructions).

  2. Run:

cd ~; wget https://repo.cloudlinux.com/cloudlinux/sources/cloudlinux_ea3_to_ea4; sh cloudlinux_ea3_to_ea4 --convert

(Find examples of cloudlinux_ea3_to_ea4 script usage below).

CloudLinux without EasyApache 4

Install EasyApache4 on clean CloudLinux from ISO image or migrate to EasyApache4 on existings CloudLinux servers:

  1. Install cPanel.
  2. Run:
cd ~; wget https://repo.cloudlinux.com/cloudlinux/sources/cloudlinux_ea3_to_ea4; sh cloudlinux_ea3_to_ea4 --convert

(Find examples of cloudlinux_ea3_to_ea4 script usage below).

More about cloudlinux_ea3_to_ea4 script

About cloudlinux_ea3_to_ea4 migration script parameters:

cloudlinux_ea3_to_ea4 [ADDITIONS] ACTIONS

Usage:

-h, --help Print this message

Actions (required parameter, shows what should script do):

-c, --convert Convert EA3 to EA4
-r, --revert Revert to EA3

Additions (optional parameter, adds to action installation of extra components):

-m, --mod_lsapi Install mod_lsapi
-p, --mod_passenger Install alt-mod-passenger
-a, --altphp Install/Update alt-php

Examples:

  • If you want to install EA4 with mod_lsapi and update/install alt-php:
sh cloudlinux_ea3_to_ea4 --convert --mod_lsapi --altphp 
  • If you want to install EA4 with mod_lsapi, alt_mod_passenger and update/install alt-php:
sh cloudlinux_ea3_to_ea4 --convert --mod_lsapi --altphp --mod_passenger
  • To restore EA3 with mod_lsapi:
sh cloudlinux_ea3_to_ea4 --revert --mod_lsapi

See also: FAQ