cPanel is the most popular Linux based web hosting control panel. It provides a graphical user interface to easily manage and host multiple websites on a single VPS or dedicated server. With the help of it’s powerful GUI we can easily perform most of the tasks we perform on a website’s server using command line, for example, uploading files, creating emails, setting cron jobs, handling databases, etc. WHM (Web Host Manager) provides a root and reseller level access interface where user can manage settings related to server administration and account management. cPanel provides a user level access interface where user can manage their web hostings.
Features of cPanel/WHM
cPanel/WHM comes with a lot of notable features, some of them are listed below.
- Multilingual GUI interface to manage a server and client websites.
- Built-in file manager and phpMyAdmin to easily manage files and databases.
- DNS support and management for both server and client websites.
- Email management with DKIM and SPF support for authentication and encryption.
- Easy SSL/TLS management for multiple domains using SNI.
- Easy Backup and Migration of client accounts within different servers.
- Can be easily integrated with almost all client management and billing software like WHMCS, Blesta etc.
Prerequisites
- A Fresh VPS, Cloud Server or Dedicated Server running CentOS 7 or CentOS 7.2. You can also choose from a wide range of SSD Cloud Servers directly from us if you don’t have one already.
- A Static IP address, cPanel can not work on a dynamic IP address which is allocated dynamically if you have DHCP enabled on your ethernet interface.
- Minimum 1 GB RAM but it is recommended that you have 2 GB of RAM.
- Minimum 20 GB Disk Space but it is recommended that you have at least 40 GB Disk Space.
- Root access to your server.
Notes
- cPanel, once installed can not be removed from your server as it does not have any uninstaller. To remove cPanel you will have to reinstall your Operating System.
- cPanel is commercial software and requires a licence to work but cPanel offers a 15 day trial, you can install your software using the trial and you can purchase the software later. The trial is automatically activated once cPanel is installed on your server.
Installation of cPanel/WHM
Before installing cPanel you must have Perl installed on your server as cPanel is written in Perl. To install Perl on your system, login as root
user and run the following command.
yum -y install perl
Now you will need to set the hostname for your server. A hostname is a FQDN or Fully Qualified Domain Name which will be used to identify your server. For example consider vps.mydomain.com
– this is a FQDN which you can use as your hostname. To change your hostname run the following command
hostname vps.mydomain.com
You can replace vps.mydomain.com
with your hostname. You must own the domain of which your are setting up the hostname.
Next, you will need to change your current directory to /home
directory, run the following command to do this.
cd /home
Download the installation script from cPanel website by executing the following command –
curl -o latest -L https://securedownloads.cpanel.net/latest
Now run the installation script by executing the following command –
sh latest
This will start your cPanel installation, you can now sit back and relax as the installation takes around half hour to complete. Once the installation script is finished you will see the following output:
2016-06-11 08:42:33 222 ( INFO): cPanel install finished in 21 minutes and 23 seconds!
2016-06-11 08:42:33 938 ( INFO): Congratulations! Your installation of cPanel & WHM 11.56 is now complete. The next step is to configure your server.
2016-06-11 08:42:33 938 ( INFO): Before you configure your server, ensure that your firewall allows access on port 2087.
2016-06-11 08:42:33 938 ( INFO): On RHEL, CentOS, and CloudLinux systems, execute /scripts/configure_firewall_for_cpanel to accomplish this.
2016-06-11 08:42:33 938 ( INFO): After ensuring that your firewall allows access on port 2087, you can configure your server.
2016-06-11 08:42:33 938 ( INFO): 1. Open your preferred browser
2016-06-11 08:42:33 938 ( INFO): 2. Type https://198.50.190.11:2087 in the address bar
2016-06-11 08:42:33 938 ( INFO): 3. Enter the word root in the Username text box
2016-06-11 08:42:33 938 ( INFO): 4. Enter your root password in the Password text box
2016-06-11 08:42:33 938 ( INFO): 5. Click the Login button
2016-06-11 08:42:33 938 ( INFO): Visit https://go.cpanel.net/whminit for more information about first-time configuration of your server.
2016-06-11 08:42:33 938 ( INFO): Visit http://support.cpanel.net or https://go.cpanel.net/whmfaq for additional support
2016-06-11 08:42:33 938 ( INFO): Thank you for installing cPanel & WHM 11.56!
You can now open your browser and go to https://your-server-ip:2087
to access WHM. Login with username root
and your root account’s password. Make sure that you use https
to access WHM in browser. For example if your IP is 192.168.0.85
then you will have to go to https://192.168.0.85:2087
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/1608938589.png” alt=”” />
Once you are logged in you will be taken to initial server setup. In Step 1 you will be shown the cPanel & WebHost Manager End User License Agreement, you can go through the agreement and click on I Agree/Go to Step 2 once you are ready.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/1836816130.png” alt=”” />
In Step 2 you will be taken to the Setup Networking section. Provide your contact information, a valid email address which should not be hosted on the same server. This email will be used for sending critical information about server.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/2020710321.png” alt=”” />
Scroll down to find hostname section, you can enter a new hostname for your server by replacing the old one which we have given during installation. If you don’t want to change the hostname, you can leave the hostname field as it is. Enter DNS resolvers for your server. Resolvers will be used to fetch DNS entries of any website. If your service provider has DNS resolvers then cPanel will automatically detect and fill them for you, if not then you can use Google’s public DNS resolvers which are 8.8.8.8
and 8.8.4.4
or OpenDNS’s public DNS resolvers which are 208.67.222.222
and 208.67.220.220
.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/402817643.png” alt=”” />
Next you can select your Main Network Device, an IP available on that device will be considered as the main IP address of your server.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/1479853442.png” alt=”” />
Once done click on Save & Go to Step 3 button.
In Step 3 you will see the section to Set Up IP Addresses. If you have more than one IP address assigned to your server and your interface, you can add them here. To add a new IP address just enter the IP address in IP Address(es) to Add field, if you have a pool of IP address you can also add multiple IP address using CIDR notations. Enter the Subnet Mask and choose the network interface. Click on Add IP(s) button to add the IP address. Down below you will see the list of current IP address available to your server.
If you wish to use the default settings just click on Skip This Step and Use Default Settings button on the top. If you have added IP address then click on Go to Step 4 button.
In Step 4 you will be taken to Nameserver configuration, you will have three options to choose from, you can compare the advantage and disadvantages of using different Name server applications. Recommended is that you choose BIND as it has most advantages. If you do not want to run a DNS server on your local machine you can disable the nameserver by choosing the disable option.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/1022863564.png” alt=”” />
Next, choose the nameserver which your server will use. You may want it to be ns1.yourdomain.com
or ns2.yourdomain.com
. You will need to create hostnames in your domain control panel. Now add A Entries
for your hostname by selecting the Add “A Entries” for Hostname checkbox.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/570768142.png” alt=”” />
Enter the IP address of your server if it is not prefilled. Finally click on Save & Go to Step 5 button to go to step 5.
In Step 5 You will see the configuration page for your services. In FTP configuration you can choose from two FTP applications, recommended is Pure-FTPD. Choose the disabled option if you want to disable the local FTP server. In mail configuration you can either choose Dovecot which is also recommended or you can choose to disable mail server by choosing disabled option.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/1561106397.png” alt=”” />
Next you can configure cPHulk Brute Force Protection, select Enable cPHulk check box to enable cPHulk. Next you can select settings for cPHulk from many options. In Advanced setting of cPHulk you can choose duration to block a user from logging in if it encounters certain failures by Account and IP address.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/1459690825.png” alt=”” />
You can also provide maximum failures before an IP address is blocked for a day. Finally click on Save & Go to Step 6 button.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/1071833708.png” alt=”” />
In Step 6 you will be asked if you want to use file system quotas. It is recommended that you select Use file system quotas options. If you choose not to use file system quotas then you will not be able to track the disk space used by any user or website.
Click Finish Setup Wizard to complete the initial setup wizard. You will now see some new features of cPanel in its feature showcase. In recommended features you will see cPanelID, which enables a user to login to cPanel with his cPanelID. This feature enables a user to login to multiple cPanels with single user id. You can enable this feature by choosing the enable option. To disable this, select No, thank you option.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/785670151.png” alt=”” />
Next, you will see cPHulk’s username based protection feature which only blocks a certain user instead of blocking the IP address so that other user may login from same IP. There are more new features like PHP-FPM, ModSecurity, cPanel Reset Password and more. You can either choose to enable them or disable them by selecting No, thank you option.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/601385134.png” alt=”” />
Once you have chosen to enable or disable a feature. Click on Save Settings button to save the settings and go to WHM. You will now see the default home page of WHM.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/484339463.png” alt=”” />
To see the user level interface of cPanel/WHM, you will need to create a user account first. Go to Home > Account Functions > Create a New Account in WHM. In the “Create a New Account Interface”, enter the main domain of user, username will automatically get filled according to the domain, you can also use a different username if you want to. Enter a password for your user, you may also use password generator to generate a strong password. Enter a valid email for your user. You can choose a package from the dropdown, but as we have installed cPanel recently there will not be any package. If you do not select any package, cPanel will provide unlimited resources to this account.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/2116723182.png” alt=”” />
Next, in the settings options, select the default theme. You can choose paper_lantern
which is a modern and responsive. If you want the old non responsive theme you can select x3
or x3mail
, choose the language in the locale setting. In the reseller setting you can make the account a reseller account. A reseller has ability to create more accounts under it. In DNS settings select the options to enable DKIM and SPF on the account. In the mail routing settings, unless required, leave the options as Local Mail Exchanger. Click on the create button to create the user account. cPanel will now run the script to create the user account and the output will be shown to you.
Now you can go to https://your-server-ip:2083
to access cPanel, you will see the login prompt like shown below. Enter the username and password you have created recently and click on Login button.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/1551935273.png” alt=”” />
Once you are logged in you will see the cPanel Home interface from where a user can manage all the settings related to their website.
HP_NO_IMG/data/uploads/users/1a4f26de-5d97-48b7-abf5-631194ef3a10/449395459.png” alt=”” />
Conclusion
In this detailed tutorial we have installed cPanel/WHM on a VPS/Dedicated Server running CentOS 7. cPanel helps you to manage multiple websites on a single shared server with ease.