How to install cpanel in a server ?
Introduction
[edit]cPanel is a popular web hosting control panel that simplifies website and server management tasks. This guide provides step-by-step instructions for installing cPanel on a CentOS 7 server.
Prerequisites
[edit]Before proceeding with the installation, ensure that you have:
1. A server running CentOS 7.
2. Root access to the server.
3. A valid Fully Qualified Domain Name (FQDN) for setting up the hostname.
4. Perl installed on your system.
Installation Steps
[edit]Step 1: Set Hostname Set the hostname for your server using the hostnamectl command:
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
hostnamectl set-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.
Step 2: Install Perl 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
Step 3: Change Directory you will need to change your current directory to /home directory, run the following command to do this.
cd /home
Step 4: Download Installation Script Download the installation script from cPanel website by executing the following command -
curl -o latest -L https://securedownloads.cpanel.net/latest
Step 5: Run Installation Script 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
Step 6: Access cPanel Web Interface
http://your-server-ip:2087
cPanel will open up its web interface
Step 7: Create New Account Log in the WHM ->manage your accounts -> create new account
Step 8: Disable SELinux
1. Check the current SELinux status,run: sestatus
2. To disable SELinux on CentOS 7 temporarily, run: sudo setenforce 0
3. Edit the /etc/selinux/config file and set the SELINUX to disabled
4.Reboot the Linux server
5.Verify it by running the sestatus and getenforce again
Step 9: Test Email Functionality
WHM -> manage your accounts -> list of accounts -> choose cpannel ->Email ->Email accounts ->choose your test account and click check mail option to send the mail .
NOTE : To Fix Automatic Disconnects from WHM & cPanel search ->Tweak settings ->security -> Cookies IP validation ->disabled then scrol save the modification.
Conclusion You have successfully installed cPanel on your CentOS 7 server. cPanel provides a user-friendly interface for managing various aspects of web hosting, making server administration tasks easier and more efficient.
Note: Remember to regularly update cPanel and your server's software for security and performance improvements.