Monday, March 26, 2018

How to install cPanel on existing centos 7 server

Warning: Installing cPanel on an existing server/configuration/installation is a huge risk and doing mistakes might cause you to wipe out or make your server unusable, do this at your own risk.

I really wanted to install cPanel on a dedicated server running centos 7. The server doesn't serve any websites and just existing to help me accomplish some tasks.

You will need to uninstall httpd, and remove any mysql databases or installation throughout the process.

However, no support was given from my host and everything online said you need to wipe our your server before installing it, here is how to install cPanel on an existing server without wipeout.

Step 0: Log in to the root account via SSH to your server, command:

ssh root@1.1.1.1 

Make sure you replace 1.1.1.1 with your server's IP address.

Step 1: If you haven't set your hostname already, do it now.  The hostname is any domain or subdomain linked to the server, in that case, I will assume it is called www.example.com. To set up your hostname, type this command:

hostname: www.example.com

If this works, the terminal will remain silent.

Step 2: If httpd is installed (highly likely), remove it by typing this command:

yum remove httpd

Then, you will be asked a question, type:



Here is a screenshot:



Step 3: If mysql is installed (highly likely), remove it by typing this command:

yum remove mysql mysql-server -y 

Here is a screenshot: 


Then run this command:

mv /var/lib/mysql /var/lib/mysql_old_backup

If there are no problems, the server will be silent when you run mv.

Step 4: Run a separate screen, to do that type:

screen

Step 5: Run this command:

cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest

You should see something like this: 


Step 6: Wait for around 30 to 45 minutes for the installation to finish. It might take more.

Step 7: Visit installed VHM login on:

www.example.com:2087


The password is the root account of the server and its password.

Step 8: Follow all necessary instructions, then go to:

www.example.com:2083

You may be able to login normally to cPanel now:


Share:

0 comments:

Post a Comment