cPanel is a popular web hosting control panel that makes it easy to manage web servers, websites, and related services. CentOS 7 is a popular and one of the most stable Linux distributions that is often installed on a VPS or dedicated servers, and if you need to install a specific version of cPanel on it, this guide will walk you through the process step by step. The fact is that new versions of the panel no longer support installation on outdated versions of CentOs and some other operating systems, so this article is intended to help circumvent this problem.
We’ll also look at potential issues you may encounter and how to resolve them, including disabling NetworkManager for a smoother installation.
Prerequisites
Before you start, make sure you have the following:
- A server running CentOS 7.
- Root or sudo access to the server.
- A specific version of cPanel you want to install. You can find the desired version on the cPanel website, for example version 98.0.8 or earlier.
Step 1: Update CentOS
First, ensure your CentOS 7 system is up to date by running the following commands:
sudo yum update
This will update the package list and upgrade installed packages to their latest versions.
Step 2: Disable NetworkManager
NetworkManager can interfere with cPanel installation, causing network-related issues. To prevent this, you should disable NetworkManager and enable the standard network service. Run the following commands:
sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager
sudo systemctl enable network
sudo systemctl start network
Step 3: Set the Hostname
cPanel requires that your server has a fully qualified domain name (FQDN) set as the hostname. You can check your current hostname with the following command:
hostnamectl
If it’s not an FQDN, you’ll need to set it. Replace yourhostname.example.com with your desired FQDN in the following command:
sudo hostnamectl set-hostname yourhostname.example.com
Step 4: Install cPanel
Now, you can begin the cPanel installation process. To do this, you need to execute a cPanel installation script. You’ll need to replace YOUR_CPNANEL_VERSION with the specific version of cPanel you want to install.
cd /home
curl -o latest -L https://securedownloads.cpanel.net/latest
sh latest –noexec
This will download the cPanel installation script without executing it. Next, you’ll edit the installation configuration file to specify the desired version.
vi /home/latest
Look for the following line:
$CPANEL_ACCOUNT = “edge”;
Replace “edge” with the desired version, for example:
$CPANEL_ACCOUNT = “98.0.8”;
Save and exit the text editor.
Step 5: Execute the Installation
Now, run the cPanel installation script with the edited configuration file:
sh latest
The installation process can take some time, depending on your server’s hardware and network speed. cPanel will be installed, and your server will be configured to run it.
Step 6: Access cPanel
Once the installation is complete, you can access the cPanel web interface by navigating to:
https://yourhostname.example.com:2083
Replace yourhostname.example.com with your server’s FQDN.
Troubleshooting Common Issues
Firewall Configuration
If you encounter connectivity issues, ensure that your firewall allows traffic on ports 2082, 2083, 2086, and 2087. You can use the following commands to open these ports:
sudo firewall-cmd –permanent –add-port=2082/tcp
sudo firewall-cmd –permanent –add-port=2083/tcp
sudo firewall-cmd –permanent –add-port=2086/tcp
sudo firewall-cmd –permanent –add-port=2087/tcp
sudo firewall-cmd –reload
Additional Packages
Sometimes, cPanel may require additional packages that are not included in the default CentOS 7 repositories. You can try installing the EPEL repository to access these packages:
sudo yum install epel-release
System Requirements
Ensure that your server meets cPanel’s system requirements for the specific version you are installing. Review the cPanel documentation or website for detailed requirements.
Conclusion
In this guide, you learned how to install a specific version of cPanel on CentOS 7. We covered essential steps like updating CentOS, disabling NetworkManager, setting the hostname, and executing the cPanel installation script. We also discussed some common issues and troubleshooting steps.
By following these instructions carefully, you can have cPanel up and running on your CentOS 7 server with the specific version you desire. Enjoy the ease of managing your web hosting services and websites using cPanel.