Skip to content

Instantly share code, notes, and snippets.

@reatlat
Last active November 27, 2018 18:09
Show Gist options
  • Select an option

  • Save reatlat/549fdeedfeb24f77bc7fd5a3c27d8118 to your computer and use it in GitHub Desktop.

Select an option

Save reatlat/549fdeedfeb24f77bc7fd5a3c27d8118 to your computer and use it in GitHub Desktop.
After updating server via SSH how to change VestaCP port and add firewall rules I run a web host that uses VestaCP as a backbone API for managing resources only, but everything has been patched and wanted to share a script to update your VestaCP port from 8083 to 5600. But only do this AFTER update and patch. It will create the firewall rule on …
echo "NodeHost Custom VESTACP Script"
echo "JOB: Changing VESTACP port"
string="listen 8083;"
stringnew="listen 5600;"
grep "$stringnew" /usr/local/vesta/nginx/conf/nginx.conf || sed -i "s/$string/$stringnew/g" /usr/local/vesta/nginx/conf/nginx.conf
echo "JOB: Complete"
echo "JOB: Changing VESTACP firewall rule for new port"
v-add-firewall-rule ACCEPT 0.0.0.0/0 5600 TCP
echo "JOB: Complete"
echo "JOB: Restarting VESTACP"
service vesta restart
echo "JOB: Complete"
echo "JOB: Port has been changed to 5600 from 8083"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment