How do I change web connection port from 80 to something else?

Frequently asked questions related to Ubuntu Desktop AMI
jsun
Site Admin
Posts: 81
Joined: Tue May 26, 2015 9:52 pm

How do I change web connection port from 80 to something else?

Postby jsun » Tue Jan 29, 2019 11:11 pm

Many times you may want to leave the web default port (80 for http, and 443 for https) to a web server and use some other ports to connect to the desktop. Here are the ways to do so.
  • For Ubuntu 14.04 and 16.04, run "Configure Ubuntu Desktop" (or "Configure AMI") script from desktop and follow instructions accordingly. Note in 14.04 and 16.04 we only support HTTP connections.
  • For Ubuntu 18.04, run the following code to change HTTP port from 80 to 8080:

    Code: Select all

    sudo sed -i "s#80#8080#g" /etc/systemd/system/websockify.service
    And run this command to change HTTPS port from 443 to 8443

    Code: Select all

    sudo sed -i "s#443#8443#g" /etc/systemd/system/websockify-ssl.service

After the above change; reboot the machine.

NOTE :
  • Please make sure the new ports you are changing to are opened by the security rules!!!
  • Obviously you now need to put the port number after the URL in browser address bar.

Return to “FAQ”

Who is online

Users browsing this forum: No registered users and 1 guest