In today’s article, AZDIGI will show you how to change the port on CentOS Web Panel (CWP) in the most detail.
When you install CentOS Web Panel (CWP), the console access ports are 2030 (without SSL) and 2031 (with SSL).
If you want to change to another port to increase security and make it easier to remember, you can follow the steps below.
II. Change port on CentOS Web Panel (CWP)
To change the port on CentOS Web Panel (CWP), we need to follow these 4 steps:
Step 1: Log in to CentOS Web Panel as root
To log in to CentOS Web Panel with the root account, we access the following path on the browser (remember to change the IP to your CWP server’s IP address) with the login port of 2031.
Remember to change
IP to the
IP address your CentOS Web Panel server is using.
Below is my CentOS Web Panel interface:
After entering the CWP interface, we continue with step 2 to open the port on CSF you want to use.
Step 2: Open Port on CentOS Web Panel (CWP) with CSF
In the feature list on the left of the screen, we select Security => CSF Firewall as shown below:
At the interface of the CSF feature, click Firewall Configuration.
At the next interface, find Allow outgoing TCP ports and add the 2 ports you want before the double quotes as shown below (remember that between different ports will need commas)
In addition, you need to add these 2 ports in the
After adding the port you need, press Save changes button.
After opening the port on CSF, we proceed to change the port on CentOS Web Panel (CWP) with SSH in step 3 and step 4.
Step 3: SSH into your CentOS Web Panel (CWP) system
To change the port on CentOS Web Panel (CWP), we first need to SSH into your VPS/Server as root. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:
After successfully SSH, we continue with step 4 to perform port change commands on CentOS Web Panel (CWP).
Step 4: Change the port on CentOS Web Panel (CWP) via SSH
I want to change Port 2030 to Port 6868 and Port 2031 to Port 6969, so I will replace the configuration parameters of the CentOS Web Panel in the following file:
After replacing and saving the configuration, we use the following command to recheck it:
grep -n listen /usr/local/cwpsrv/conf/cwpsrv.conf
If the parameters display the ports correctly you have changed as shown below, it is successful.
Then we need to restart CentOS Web Panel to get the new configuration parameters. To restart CentOS Web Panel and CSF, run the following command:
sh /scripts/restart_cwpsrv csf -r
Finally, you can connect to the new port that you changed.
After accessing the new port, you can delete the 2 old ports in CSF to increase security.
With just 4 simple steps above, you can change the CentOS Web Panel (CWP) port. Customizing the login port will make your CentOS Web Panel more secure than leaving the default port.
Hope this article will be of help to you. Wishing you success!
See more useful articles about CentOS Web Panel at the following link:
If you need assistance, you can contact support in the ways below: