Are there good alternative HTTP ports rather than port 80?

107,326

Solution 1

Many ISPs block port 80 (HTTP) and port 25 (SMTP), as well as some other ports to home users. Typically, their response to this is that these protocols are "business related" or something along those lines. I assume this is the case for you.

Port 80 is the standard for HTTP. When you typer superuser.com into your browser's address bar, it assuming two things:

  1. Since you left the protocol out, it assumes HTTP (http://superuser.com)
  2. Since you left the port out, it assumes port 80, based on the HTTP assumption (http://superuser.com:80)

Since port 80 is not an option, you need to find an alternative port. There is no official HTTP alternative port.

When port 80 is used for one address/webserver, it's fairly common to use port 8080 or 8000 for another site on the same address/webserver. This is most likely because they are similar enough to 80 that they are easy to remember. I have seen this done for external facing sites as well.

Alternatively, you can use any port you want. See this list of standard and unofficial ports. You could run it on port 23, if you didn't plan on using telnet to your Linux machine. In a web browser, you would just type domain.com:23.

Solution 2

There are actually 3 HTTP alternative ports: 591, 8008 and 8080.

They are assigned by IANA as "HTTP Alternate", which makes them pretty much as official as it gets.

If you run Linux as a non-privileged user (non-root) you can listen to any port above 1024, so 8008 and 8080 are good candidates. Then to access the server from your browser, you will need to specify the port in the url, such as http://localhost:8080.

You may also use ports in the range 49152–65535. They are labeled as "Dynamic Ports" and will never be assigned by IANA, however because of that they may already be used by other software. This means that you can't trust that a given port will be available for you to use at any given time and have to check the availability of the port each time you want to use it.

Note that port 8000 is sometimes used for HTTP, but IANA assigned it to iRDMI (Intel Remote Desktop Management Interface). While it is unlikely to be an issue in a private environment, it is best to refrain from using it for HTTP given better alternatives are available.

Share:
107,326

Related videos on Youtube

David
Author by

David

Updated on September 18, 2022

Comments

  • David
    David almost 2 years

    I have been looking for some documentation on alternatives to port forwarding to port 80. I have a dedicated Linux machine on a home router, and apparently utilizing port 80 is not an option.

    Are there good alternative HTTP ports? (Or, I am open to some work-around to this situation as well.)

    • DKing
      DKing over 5 years
      Is port 443 for HTTPS blocked as well? It is becoming more popular lately to force HTTPS, and one sure way to do that is to close port 80. But why is 80 not an option? If you are not the root user, you cannot bind to anything below 1024.
  • David
    David about 11 years
    Thank you Keltari, I appreciate it. Through this post you actually taught me A LOT, and I am very thankful. The next thing for me to investigate after selecting an alternate port is what steps to take (if any) to ensure I can 'be found' by the external 'world' (so that my small Web site can be noticed by, for example, employers whom I am tying to display proof of my Web efforts).
  • Calimo
    Calimo over 9 years
    IANA defines 591, 8008 and 8080 as http_alt or HTTP Alternate. That's pretty much as official as it gets...
  • david.barkhuizen
    david.barkhuizen almost 9 years
    the wikipedia entry for List_of_TCP_and_UDP_port_numbers (en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers) also states: "The range 49152–65535 (215+214 to 216−1) contains dynamic or private ports that cannot be registered with IANA. This range is used for private, or customized services or temporary purposes and for automatic allocation of ephemeral ports." so you can also officially use any port in that range, i.e 49152–65535, although I don't know if those qualify as 'good' alternatives.
  • Clifford Fajardo
    Clifford Fajardo over 6 years
    For the alternative ports, does this you need to explicitly type out the domain with the alternative port at the end of the URL?