How to change cpanel port through command line
WHM/cPanel is one of the commonly using control panel in web hosting industry. We already discussed about the cPanel installation on server and some other topics related with cPanel/WHM. The installation steps are quite simple for cpanel. You can refer this link for getting more details on cpanel installation “Install Cpanel on centos – step by step procedure“.
Default port numbers of cPanel and WHM
To access the WHM, cPanel, webmail etc cPanel has default port numbers. The default port numbers for cPanel and WHM are listed below:
cPanel : 2082/2083(ssl)
WHM : 2086/2087(ssl)
How to change cpanel port – Command line option?
Yes, it is possible to change the port number from its default value. The port value for cPanel is defined in the configuration file ‘/var/cpanel/cpanel.config’. You can edit the value from here. Please do follow the steps explained below:
1, SSH to server as root user.
2, Open the configuration file by using your favourite editor and change the port number.
vi /var/cpanel/cpanel.config ---------- port=2082 ---------- :wq
After changing the port value, run the following commands for it to take effect:
# /usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings # /etc/init.d/httpd restart
That’s it… 🙂