Installation Prerequisites
- A fresh and minimal installation of CentOS 6.5 server.
- A minimum of 1 GB.
- A Minimum of 20GB free disk space required for cPanel installation.
- A cPanel license.
Method 1 =
Installation of cPanel in CentOS and RHEL 6
First insure that OS version on which your Linux box is running, to do so, please use following command.
# cat /etc/redhat-release CentOS release 6.4 (Final)
If you don’t have the latest version, please update your OS to its latest version, In CentOS and RHEL, we can simply do it with yum package installer.
# yum update
Once updates completes, and then check the latest OS version with same above command.
# cat /etc/redhat-release CentOS release 6.5 (Final)
Next, ensure that your system has a standard hostname, otherwise set it as follows.
# hostname ls0.wmirchi.com
Once you’ve ensured the OS version and hostname, you don’t have to install any other dependency packagees, cPanel auto installer script does all for you. We can download cPanel installer file under /home directory.
# cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
This above command changes your session to the home directory, downloads the most recent version of cPanel & WHM, and runs the installation script.
Important: I strongly recommended to run cPanel auto installer script in screen mode if you are doing it with SSH because it takes 30-40 minutes to complete the installation depending on your server resources and bandwidth speed.
Method 2 =
Setup
Before installing cPanel on our droplet, we need to take two additional steps.
First we need to make sure that Perl is installed on the server
sudo yum install perl
After installing perl we need to take one more preliminary step. cPanel is very picky about making sure that server that it is installed on has a Fully Qualified Domain Name. To that effect, we need to provide it with a valid hostname. Skipping this step will inevitably get you the following, very common, error.
2018-01-01 12:00:54 461 (ERROR): Your hostname () is not set properly. Please 2018-01-01 12:00:54 462 (ERROR): change your hostname to a fully qualified domain name, 2018-01-01 12:00:54 463 (ERROR): and re-run this installer.
Luckily this error has a very easy solution. If you have a FQDN, you can type it in with the command:
hostname your FQDN
Otherwise, if you want to proceed with the cPanel installation but do still lack the hostname, you can input a temporary one. Once cPanel is installed, you will be able to change the hostname to the correct one on one of the first setup pages.
hostname host.example.com
Install cPanel
Although the cPanel installation only has several steps, the installation does take a long time. Although using program "screen" is not necessary in order to install cPanel, it can be a very helpful addition to the installation process. It can be especially useful if you know that you may have issues with intermittent internet or that you will need to pause the lengthy install process.
To start off, go ahead and install screen and wget:
sudo yum install screen wget
Once screen is installed, start a new session running:
screen
After opening screen, you can proceed to install cPanel with WHM or a DNS only version of cPanel.
- Use this this command to install cPanel with WHM:
wget -N http://httpupdate.cPanel.net/latest
- Use this command to install the DNS only version of cPanel:
wget -N http://httpupdate.cPanel.net/latest-dnsonly
With the requested package downloaded, we can go ahead and start the script running:
sh latest
Then close out of screen. The script, which may take one to two hours to complete will continue running while in the background—even if you close out the of server.
In order to detach screen type: Cntrl-a-d
To reattach to your screen you can use the command:
screen -r
Once cPanel finally installs, you can access the login by going to your ip address:2087 (eg. 192.9.6.6:2087l) or domain (example.com:2087)
Your login will be:
username: root password: your_password
Verify the cPanel license:
From SSH:
# /usr/local/cpanel/cpkeyclt
Online:
https://verify.cpanel.net/