In this tutorial, I will be going through the process of how to install CPanel on a CentOS Virtual Machine. This tutorial will be roughly based upon CPanel Installation Guide located on their website. In order to install cPanel, you will need a licence. You can use a trial licence which will automatically be applied to your IP Address if your IP isn't licenced. If you dont have one, you can purcahse one from BuycPanel.com which seem to be the cheapest provider out there.
The first thing we are going to be doing is to make sure that there arent any conflicting packages currently installed on the server.
You can view this by typing
From my installation, I can see that the following are installed.
If you find any of these listed below, you will need to remove them.
- FTP Server
- GNOME Desktop Environment
- KDE (K Desktop Environment)
- Mail Server
- E-mail Server
- Web Server
- X Window System
You can remove them by typing:
yum groupremove "FTP Server" "GNOME Desktop Environment" "KDE (K Desktop Environment)" "Mail Server" "E-mail Server" "Mono" "Web Server" "X Window System"
The above should remove them all but you only need to type the ones which are currently installed. When you do this, you will be asked if you would like to continue. Once all of these have been installed, you will need to make sure that the firewall (iptables) is disabled and then update the server.
chkconfig iptables off service iptables stop yum update
After all the packages have been updated, we can then install perl as this will be needed during the install.
yum install perl
We can now download the installer form CPanels website. when we do this, make sure that we are in the /home directory.
cd /home wget -N http://httpupdate.cpanel.net/latest sh latest
The installation process can be quite a lengthy one so you may have to wait awhile. It will depend on the power of your server along with your internet connection. I have had this take anywhere from 1 hr to 6 hrs.
Once this has been installed, you may need to run the script to make sure it has the correct licence installed. You can do this by typing
If you don't have a licence, you can go and just use the trial licence which will be generated automatically for 15 days. If not, you can buy one from BuycPanel.com which seem to be the cheapest provider out there.
You can just click Proceed anyway. You can then log in to your server using your root username and password.
Once logged in, you should be greeted with the cPanel End User Agreement. If you just have a quick read through and then click the I Agree button. On this next page, you will be able to fill out your server contact information, your hostname (which will need to be a fully qualified domain e.g. inferno.wilson18.com), your namesevers you would like to use to resolve dns queries and select your main network adapter.
One the following page, you will be able to add other IPs which you may own. An example of this can be seen on the image below.
If you are adding a large number of IPs, it may take a long time. For the amount I added in the picture, it did take some time. Each IP that is added will be added to a new virtual network interface. You can see how this looks.
Once you have added those, you can then continue. On the next page, you will be asked to select your nameserver configuration. You are given 3 options for different packages to handle this on your server. The package which is suggested is BIND which is what I will be using. If you would prefer to use others then you can do. Below this, you can then register your nameservers and have the ability to add Add A Entries for Nameservers & Hostname. After this, you can click Save & Go to Step 5.
The next step is to set up FTP and Mail Servers. For the FTP Server, it is recommended to use the Pure-FTPD (which is the default). For the mail servers configuration, it is recommended to use Dovecot. You also have the option to Enable cPHulk which will help protect against Brute Force attacks. You can then also choose to install the common set of Perl Modules which I will be enabling. You can then save these settings.
The final step will ask you if you would like to use the file system quotas. If you are using a virtual machine, this may not be supported. I had found that one some VPS providers which use OpenVZ, this is broken. Your provider should be able to fix this if they know what they are doing. If you are on a dedicated machine, then you should go ahead and enable this. You can then click the Finish Setup Wizard.
The next section will allow you to enable certain features. You can see these below along with those that I have selected to enable.
You can then save these settings.
You have successfully installed cPanel.
Below you will find a link to other useful cPanel Tutorials