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… 🙂

Related

1, How to change ftp port – cpanel
2, How to change the apache port via command line in cpanel

Arunlal Ashok

Linux Server Administrator. I'm dealing with Linux servers since 2012. I started this blog to share and discuss my ideas with the world. Check My Profile!! in uPwork (oDesk) and let me know if you need any assistance. Thanks!!

You may also like...

3 Responses

  1. December 18, 2013

    […] Similar topic : How to change cpanel port through command line […]

  2. January 3, 2014

    […] links: How to reset SSH port from WHM How to change cpanel port through command line How to change the apache port via command line in […]

  3. January 20, 2014

    […] Links: How to change cpanel port through command line How to change the apache port via command line in cpanel How to change ftp port – […]

Leave a Reply

Your email address will not be published. Required fields are marked *