How to Install and Configure Cpanel/WHM in CentOS 6/5

If you would have ever hosted a domain online, you would have certainly heard about the cPanel. cPanel is a Linux based web hosting control panel initially released in 1996 by John Nick Koston. The company is currently being headquartered in Houston, Texas. cPanel offers a web based graphical interface and various tools designed especially to reduce day to day daunting tasks of a system administrator to manage a web hosting server and the website.
cPanel is divided into two tiers 1. whm i.e. web hosting manager 2. cPanel. Web hosting manager i.e. whm is used to administrate the server whilst cPanel offers graphical interface for end user to run and manage their website with ease. I have listed a handful of cPanel features below.

Features of cPanel.

cPanel is the most efficient and rich-featured control panel and comes with number of inbuilt tools to make life easier for system administrator as well as for end users too.

  • It has powerful GUI which enables you to perform number of tasks in a single click.
  • Inbuilt tools to manage mail server and the dns server with ease.
  • Inbuilt tools to monitor services and restart automatically if goes down.
  • Excellent backup management. You can schedule daily, weekly and monthly backups to local server or remote server.
  • Powerful system health interface to view data about active processes, disk usage and real time running processes on the server.
  • Easily re-brand it as per your needs.
  • Inbuilt phpmyadmin tools to manage your databases online.
  • More than 500 add-ons available to cater your needs.

Step by step guide to install and configure cPanel.

System Requirements for cPanel installation

  • A freshly installed VPS or Dedicated server running centos 6 operating system.
  • Recommended 226 MHz Processor.
  • Recommended 20 GB of disk space. If you are going to host large number of websites, we recommend bigger hard drives.
  • Recommended 1 GB of RAM.

Recommended Partitions

  • Minimum swap space – Two times the amount of RAM on the server.
  • Recommended / partition – 40 GB
  • Recommended /boot partition – 250 MB
  • Recommended / partition – 16 GB or larger. This partition holds logs for cPanel and the apache so if your logs keep growing you might need more space unless you delete old logs.
  • Recommended /var partition – 40 GB or more.
  • Recommended /home partition – Remaining space.
  • Recommended /tmp partition – 2 GB

Installation of cPanel in Centos 6

First of all make sure you have valid fqdn i.e. fully qualified domain name as a hostname. You can ensure it by running following command.

If you do no have fully quailifed domain name as a server hostname yet you run the cPanel installer, you might encounter following error.

You can setup Fully Qualified Domain Name (fqdn) easily. In terminal, execute.

# vi /etc/hosts

And modify your host files replacing the hostname, yourdomain, tld, and YourIP values with your own. Your file should like below.

127.0.0.1 localhost.localdomain localhost
127.0.1.1 hostname.yourdomain.tld hostname
YourIP hostname.yourdomain.tld hostname

You can veify that the hostname is setup properly, execute following command.

# hostname -f

If you do not have latest version of the operating system, you can easily update os to latest version by using yum. Just run following command.

# yum update

Sample Output

# yum update
Loaded plugins: fastestmirror, security
Setting up Update Process
Determining fastest mirrors
 * base: mirror.rackspace.com
 * extras: yum.tamu.edu
 * updates: mirror.oss.ou.edu
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 4.3 MB 00:01
Dependencies Resolved

I have not listed whole output here but once yum update is completed it will show you complete message.

You can verify operating system by running following command.

# cat /etc/issue
CentOS release 6.8 (Final)
Kernel \r on an \m

You have met all prerequisites for the installation. Now You can start installing the cPanel. just download the cPanel installer in home directory with wget command. If wget command does not exists on the server, install it using yum.

# yum install wget -y

Download cPanel installer in /home directory.

# cd /home/
# wget -N http://httpupdate.cpanel.net/latest

Sample Output

--2017-02-02 19:18:53--  http://httpupdate.cpanel.net/latest
Resolving httpupdate.cpanel.net... 216.12.197.42, 72.29.88.74, 208.109.109.239, ...
Connecting to httpupdate.cpanel.net|216.12.197.42|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://securedownloads.cpanel.net/latest [following]
--2017-02-02 19:18:54--  https://securedownloads.cpanel.net/latest
Resolving securedownloads.cpanel.net... 208.74.121.38, 208.74.123.12
Connecting to securedownloads.cpanel.net|208.74.121.38|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26595 (26K)
Saving to: “latest”

100%[=============================================>] 26,595 --.-K/s   in 0.03s

2017-02-02 19:18:54 (1004 KB/s) - “latest” saved [26595/26595]

Above output shows, we have downloaded cPanel auto installer script file named as latest. Next, we simply need to execute this auto installer script to begin the installation. It’s highly recommended to run this script in screen mode as the cPanel itself takes around 1-2 hours to get completed. If you have low resources such as memory, it can even takke 3-4 hours.

# sh latest

Sample Output

Verifying archive integrity... All good.
Uncompressing cPanel & WHM Installer.....
        ____                  _
    ___|  _ \ __ _ _ __   ___| |
   / __| |_) / _` | '_ \ / _ \ |
  | (__|  __/ (_| | | | |  __/ |
   \___|_|   \__,_|_| |_|\___|_|

  Installer Version v00061 r019cb5809ce1f2644bbf195d18f15f513a4f5263

Beginning main installation.
2017-02-02 12:25:22  720 ( INFO): cPanel & WHM installation started at: Thu Feb  2 12:25:22 2017!
2017-02-02 12:25:22  721 ( INFO): This installation will require 20-50 minutes, depending on your hardware.
2017-02-02 12:25:22  722 ( INFO): Now is the time to go get another cup of coffee/jolt.

Once the installation is completed, following output will be shown on screen.

2017-02-02 12:54:15 1114 ( INFO): Thank you for installing cPanel & WHM 11.62!
2017-02-02 12:54:15  993 ( WARN): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2017-02-02 12:54:15  994 ( WARN): Your system kernel may have been updated.
2017-02-02 12:54:15  995 ( WARN): Current kernel (2.6.32-642.el6.x86_64) has been changed to: 2.6.32-642.13.1.el6.x86_64
2017-02-02 12:54:15  996 ( WARN): Before rebooting the system, please ensure that the installed kernel version is compatible with your deployment.
2017-02-02 12:54:15 1006 ( WARN): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

The cPanel installer has updated the system kernel hence we will need to reboot the server to boot new kernel. Please make sure to update your grub.conf to boot latest kernel.

Once your server gets back online, you can access your webhost manager using following URL.

http://your-host-name:2087
OR
http://your-server-ip:2087

Just enter root and it’s password to login.

In next post, we will discuss initial cPanel setup.

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge