By default, the VestaCP login port uses 8083 and uses SSL. However, if you want to customize the login port, it can be changed according to your wishes or for security reasons.
Before changing the configuration, we must first add the firewall port that will be used. Make sure the port is not used by other services on the server. In this study case we take the example of wanting to change to a custom port 4591.
Add Port to Firewall
Add to Firewall first.
- Login to VestaCP Dashboard
- Go to the Firewall menu
- Add rule
- Action ACCEPT
- Protocol TCP
- Port 4591
- IP Address 0.0.0.0/0
Change Configuration via SSH
We will edit the /usr/local/vesta/nginx/conf/nginx.conf file, but make sure to make a backup first so that if it is wrong it can be restored.
cp -p /usr/local/vesta/nginx/conf/nginx.conf /usr/local/vesta/nginx/conf/nginx.conf-backup
then start editing the file.
Then find config on this line:
# Vhost server { listen 8083;
Then change the number 8083 to 4591 and save.
Finally, don't forget to restart the vesta daemon so that it can immediately use the desired port, which is 4591.
service vesta restart