How to change your cPanel default port through command line on CentOS Linux server ?

How to change your cPanel default port through command line on CentOS Linux server ?

WHM/cPanel is the most popular hosting control panel used world wide by hosting companies. Default port numbers for cPanel and WHM are 2082/2083 and 2086/2087 respectively.

Today we will learn to change default cPanel port. First of all you will need root access to change cPanel default port. The value of the port is defined in the configuration file of cPanel /var/cpanel/cpanel.config
We can edit the value in this file to change cPanel default port.

1). Login to SSH as root.

2). Run this command to open cpanel configuration file :

# vi /var/cpanel/cpanel.config
Now look for this value "port=2082" in the file and change it to the port any number like 2099. Now save and exit.

3). After done this changes you have to run this command to make in affect for these changes.

# /usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings
# /etc/init.d/httpd restart
Now all changes are applied. Now you have to also look for the port number port number you have used as cPanel port is added in server firewall allowed ports or not.
If it is not allowed than you to add it.
Author
bhawanisingh
Views
1,246
First release
Last update
Rating
0.00 star(s) 0 ratings
Top