Accéder au contenu principal

How to Install Cpanel/WHM in RHEL/CentOS 6/5

ici quelques notions de bases que je vous invite à lire avant de commencer

Basculer un clavier en AZERTY ou en QWERTY sous Linux
setxkbmap fr

Se connecter en adminstrateur
su - root
yum update  ( Yellowdog Updater, Modified )






cPanel is one of the most popular Commercial control panel for Linux web hosting, I have been working with cPanel for 2+ years to manage all Shared, Reseller and business hosting customers. It comes with cPanel and Web Host Manager, which makes web hosting easier for you. WHM provides you root level access to your server whereas cPanel provides user level access interface to manage their own web hosting account on the server.

Features of cPanel

cPanel control panel is very versatile control panel for managing your hosting servers, It has lots of features which make Web hosting easier for you. Some of them are listed below:
  1. Powerful GUI controls on your server with WHM.
  2. Can perform tedious tasks like Backups, Migrations and restorations in a very easy and smooth manner.
  3. Excellent DNS and mail server management for main server and as well as client account.
  4. Can easily switch/enable/disable services for server.
  5. Can configure SSL/TLS for all server services and client domains.
  6. Easy integration with Phpmyadmin to provide a web based interface to manage your MySQL databases.
  7. Feel free to Rebrand it.
  8. Can be easily integrated with WHMCS to automate billing management.
Here In this article, We’ll be covering cPanel & WHM installation on RHEL/CentOS 6.5 and share some more useful information which will help you to manage cPanel & WHM.

Installation Prerequisites

  1. A fresh and running VPS or dedicated CentOS 6.5 server.
  2. A minimum of 384MB RAM.
  3. A Minimum 20GB of free disk space required for cPanel installation.
  4. A cPanel license.

Installation of cPanel in RHEL/CentOS 5/6

First insure that OS version on which your Linux box is running, To do so, please use following command.

[root@tecmint ~]# 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.

[root@server1 ~]# yum update
Once updates completes, and then check the latest OS version with same above command.

[root@server1 ~]# cat /etc/redhat-release

CentOS release 6.5 (Final)
 
Once you’ve ensured the OS version, you don’t have to install any other dependency package cPanel auto installer script does all for you. We can download cPanel installer file with wget command under /home directory.

root@server1 [~]# cd /home
root@server1 [~]# wget -N http://httpupdate.cpanel.net/latest
Sample Output
--2013-12-18 21:59:23--  http://httpupdate.cPanel.net/latest
Resolving httpupdate.cPanel.net... 208.82.118.100, 208.109.109.239, 209.85.80.214, ...
Connecting to httpupdate.cPanel.net|208.82.118.100|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 34087 (33K) [application/octet-stream]
Saving to: `latest'

100%[======================================>] 34,087      42.5K/s   in 0.8s

2013-12-18 21:59:24 (42.5 KB/s) - `latest' saved [34087/34087]
 
In above output you can see that we have downloaded a file “latest” in our home directory.
Next, execute the auto installer script, but we strongly recommended to run cPanel auto installer script in screen mode if you are doing it with SSH because it takes 3-4+ hours to complete the installation depending on your server resources.

root@server1 [~]# sh latest
Sample Output
Verifying archive integrity... All good.
Uncompressing cPanel & WHM Installer..............
        ____                  _
    ___|  _ \ __ _ _ __   ___| |
   / __| |_) / _` | '_ \ / _ \ |
  | (__|  __/ (_| | | | |  __/ |
   \___|_|   \__,_|_| |_|\___|_|
Installer Version v00029 r6849459174e3809f72de2bef81427a8a45399d66
Beginning main installation.
------------------------------------
------------------------------------
 
Now, you need to wait for the cPanel installer script to complete its installation.

What Auto Installer Script Does for You

cPanel heavily modifies your operating system and that is the reason that no cPanel Uninstaller available on the web so far, you need to reformat your server to remove cPanel completely from your server.
  1. It checks for various packages to ensure that there will be no conflicts and it finds any package conflict, it uninstalls previous packages with yum and that’s why its recommended to install cPanel on a Fresh OS.
  2. Downloads language and base files for installation.
  3. Installs various Perl modules through CPAN and other required packages with yum.
  4. Downloads and compiles PHP and Apache with various associated modules.
Once that script completes its installation, it will shows up that cPanel installation is complete. You may be asked to reboot the server after installation.
After that you need to complete the installation wizard from its web based interface and you can access WHM with the following URL.

http://your-server-ip:2087

OR

http://your-host-name:2087
 
cPanel will open up its web interface like similar to below.


Please login with user “root” and your password. There are some more clicks remaining to complete the cPanel installation. Agree End User License Agreement by clicking “I Agree?/Go to Step 2” button:



Accept cPanel Agreement

Please do provide the working email address and contact SMS address in the column of “Server Contact Email Address” and “Server contact SMS address” respectively because your cPanel sends all important alerts, notification to this EMail-id (Recommended). You can fill the rest details as well, if you have one.

cPanel Network Setup

Please provide a valid FQDN hostname and Resolver entries for your server in this Networking section, you can use Google resolvers in this section if you don’t have your ISP’s resolvers. Please see the image below.


Add Hostname

If you have more than one IP attached with your NIC card and you want to set up a specific IP for your Server’s main IP, you can do that from here, to do so please choose the IP from the drop down and click on “Go to Setup 4”.


Setup IP Address

In the 4th setup wizard, you can select DNS server which you want to use. You can choose one of them according to their Advantages, disadvantages and your server resources. Please read the comparison carefully and select the DNS server. Please see the image below.


Setup Name Servers

In the same step, please write down Name Servers you want to use in format of ns1/ns2.example.com. Also, Add an A entry for your hostname and nameserver by selecting the check box, please see the image below.


Add Name Server

You can select and set up different services like FTP, Mail and Cphulk in the Step 5 of this web based wizard, please see the snapshots and description below.
You can select FTP server of your choice from this wizard, which you want to use for your server depending on their advantages, disadvantages and depending upon your ease and requirements.


FTP Configuration

In the same wizard, you can select your Mail server to be used for all your mailing activities in future. You can add MTAs like Exim with your cPanel in future.


Mail Configuration

Cphulk brute force protection detects and block false password attacks activities and block their IP for your server. You can enable/disable and configure it from this installation wizard. Please see the snapshot below.


Setup Cphulk Brute Force Protection

Last Step 6, allows you to enable quotas which helps you to track down the disk space usages.


Setup User Quotas

Please select “Use file system quotas” and click on “Finish setup wizard” to complete the Installation process. Once you are done with Installation, WHM’s home page will Appear like below..

cPanel Server Configuration

You can see that Home page of WHM is displaying all Control panel option and sidebar with search facility which allows you to search options by just typing their names.
Sometimes, cPanel installer script is not able to update the licence because of firewall or resolvers entries and you’ll see trial warning in the page. You can do it manually with following command.
root@server1 [~]# /usr/local/cpanel/cpkeyclt
As I told you above that Cpanel is for user level access and WHM is for root level access, you need to create an account with option available in WHM. Here I have created an account with the username “tecmint” to show you the view of cPanel for users. Please see the image below.




cPanel Preferences
Other Useful thing to know before you start working with Cpanel and WHM.

CPanel Backend Files

  1. Cpanel directory : /usr/local/cpanel
  2. Third Party tools : /usr/local/cpanel/3rdparty/
  3. Cpanel addons directory : /usr/local/cpanel/addons/
  4. Base files like Phpmyadmin, skins : /usr/local/cpanel/base/
  5. cPanel binaries : /usr/local/cpanel/bin/
  6. CGI files : /usr/local/cpanel/cgi-sys/
  7. Cpanel access & error log files : /usr/local/cpanel/logs/
  8. Whm related files : /usr/local/cpanel/whostmgr/

Important conf files

  1. Apache configuration file: /etc/httpd/conf/httpd.conf
  2. Exim mail server conf file:/etc/exim.conf
  3. Named conf file : /etc/named.conf
  4. ProFTP and Pureftpd conf file :/etc/proftpd.conf and /etc/pure-ftpd.conf
  5. Cpanel user file: /var/cpanel/users/username
  6. Cpanel configuration file (Tweak settings) : /var/cpanel/cpanel.config
  7. Networking configuration file: /etc/sysconfig/network
  8. Addons, parked and subdomain information: /etc/userdomains
  9. Cpanel update config file: /etc/cpupdate.conf
  10. Clamav conf file: /etc/clamav.conf
  11. Mysql configuration file: /etc/my.cnf
  12. PHP ini conf file : /usr/local/lib/php.ini

Reference Links

cPanel/WHM Homepage
For now that’s all with Cpanel installation, there are so many features in Cpanel and WHM which help you to setup web hosting environment. If you face any problem with setting up Cpanel in your Linux server or need any other assistance like backups, restorations, migrations etc, you can simply contact us.
Till then, Stay connected with Tecmint.com for more exciting and interesting tutorials in future. Do leave your valuable comments and suggestions below in our comment section.

Source : http://www.tecmint.com/install-cpanel-whm-in-rhel-centos/

Commentaires

  1. Recently I actually have ordered a vps from Phi9 net host. once the roaring installation of cPanel, everything works fine.
    Thank you for your nice article. plesk offshore technical support service

    RépondreSupprimer
  2. Thanks, I admire the valuable information you offer in your articles. i would recommend 24x7ServerSupport because they provide cpanel server management which is available 24x7 to solve all your cPanel server issues at the affordable prices. Get your cPanel server support now!

    RépondreSupprimer

Enregistrer un commentaire

Posts les plus consultés de ce blog

Zimbra install let's encrypt

 https://inguide.in/how-to-install-free-ssl-certificate-on-zimbra-mail-server/ Je change le domaine  ingu.pw In the article  Install Zimbra Mail Server o n CentOS 8, we learned to install Zimbra on CentOS. This article discusses the steps required to install the Let’s Encrypt free SSL certificate in Zimbra. Installing Free SSL Certificate on Zimbra: Method 1 This method is a proven one though you have to manually do all the steps. Another method discussed below is partially automatic, which might come in handy if you didn’t encounter any error during installation (working at the time of writing this article). So, let’s begin with method 1. First of all, add  epel repository  to the server 1 [root@mail ~]# yum -y install epel-release Install snapd Now, install  snapd  package with the following command 1 [root@mail ~]# sudo yum install snapd After the above step, you need to enable snapd. 1 [root@mail ~]# sudo systemctl enable --now snapd.socket Sometim...

Open Media Vault NAS change password

Known Root Password Login to the OMV using the root user and the current password via SSH or Console enter the following command passwd root The new password is now active. Unknown Root Password, but Admin Access to OMV GUI is Available In this scenario we still can help ourselves with the GUI. The method we use is, that we create a cron job for the root user which then resets the password. Navigate to System -> Cron Jobs Press the +Add button UN-tick the enabled box, so that the cronjob does not run automatically. put into the command field the following line, replace newpasswd with your password: echo "root:newpasswd" | chpasswd press okay select the newly created cron job Click the run button. in the opening window click the start button. It will shortly deactivate and activate again. open ssh or console and login as root with your new password. Root and Admin Password Unknown If you do not know the root password, you need to boot with a Li...

cPanel DDOS attack - Mitigate Slowloris Attacks - mod_qos

Apache mod_evasive Mod_evasive is a module available for the Apache HTTP server that can automatically block attacks by rate-limiting any IP that sends too many requests in a short time. Start by installing the module from WHM’s  EasyApache 4  interface. Select the  Currently Installed Packages  profile, search for  mod_evasive  in the  Apache Modules  section, and then install it. The default settings are good for most servers, but you can tweak them further by editing the configuration file  /etc/apache2/conf.d/300-mod_evasive.conf . You can also whitelist specific IP addresses or classes, so legitimate requests are not blocked. Configure CSF to block attacks While  mod_evasive  works very well, it only protects the Apache webserver. In order to harden other services as well, you can install the free  ConfigServer Security & Firewall  (CSF), which also includes a WHM plugin. As the  root  user, install CSF ...