0

I have set up my local web server to use port 8000 for http and 8444 for https, because I often have contention for default port 80.

My web server starts fine, showing it uses port 8000 for http, and using Opera browser (my browser of choice), I can't open any site using, for example, http://abc.loc. I have to type in http://abc.loc:8000. So - I am assuming this is the browser's interpretation, or maybe something in Windows I can change, and not the web server. I want to be able to just type http://abc.loc, and the site opens.

Any ideas of how to tell Windows/Opera to use the port as assigned by the web server and not default port 80?

Kobus Myburgh
  • 1,114
  • 1
  • 17
  • 46
  • If you have contention for port 80 just kill the process that's using port 80 – slebetman Aug 13 '19 at 11:23
  • Thank you, but the problem is that when I work at another client, their system hogs port 80, and I need both applications at the same time. I therefore settled with my local web server on port 8000, which works, but is just inconvenience more than anything else. – Kobus Myburgh Aug 13 '19 at 11:28
  • So the client wants to run two websites at `http://abc.loc`? How would the browser even know which website to load? – slebetman Aug 13 '19 at 11:29
  • No, my webserver is a PHP development environment, and the client's app is some legacy desktop app, which I am not even sure in what language it was written (it has a Windows XP-like interface). It has no configurable port options, and when that runs, I can't start my local web server. – Kobus Myburgh Aug 13 '19 at 11:33
  • 1
    Sounds like you need a proper enviroment to run your app, or make subdomain for you app with some reverse proxying. Setting a browser up for this seems overcamplicated. How about just making a bookmark of the abc.loc:8000 url? – tonsteri Aug 13 '19 at 11:40
  • 2
    There is one other option. But it will either cost you money or you have to click through the browser's "This page is not secure" page. Run your app on port 443 and install an SSL/TLS certificate. Then in your browser use `https://` – slebetman Aug 13 '19 at 11:42
  • if you can use @slebetman 's idea (https port available), you can get a cert for free at https://letsencrypt.org/ – tonsteri Aug 13 '19 at 11:52
  • @tonsteri The cert is free but you will need a domain name and a public http server to use it. I suppose you can use a free dynamic dns service and a free AWS or Azure account to do it – slebetman Aug 13 '19 at 11:55

1 Answers1

1

I don't think you can do that.

80 is the TCP port assigned for HTTP traffic. That's the port that all public facing web servers listen to for HTTP. Logically browsers use this port by default.

Using anything else than this default is used for testing, "hiding" the service from crawlers and users, or because someone wants to start a web server without root privileges.

tonsteri
  • 683
  • 7
  • 15
  • There are some "alternative ports" mentioned on the web for HTTP traffic, as mentioned here as well as other places: https://stackoverflow.com/questions/32478277/is-there-any-standard-alternative-https-port. So - not sure if non-accepted answer there is correct, but if it is correct, that it is officially alternative ports, then my requirement should not be that far out of reach. – Kobus Myburgh Aug 13 '19 at 11:31
  • 1
    There are some defaults that different apps use for dev env, 8080, 8000, etc. but they are not standardized in any way and routers / firewalls do not respect that. they are just conventions for developers. – tonsteri Aug 13 '19 at 11:34
  • Okay, seems I was wrong - they appear on https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Registered_ports as official ports. But it still would make no sense to set a browser to use those as default – tonsteri Aug 13 '19 at 11:37
  • I also saw that Wikipedia article. But if they are official, my request should then be possible. I will keep your answer as the accepted answer, unless someone comes up with an answer that is provable to the contrary. Thanks for your assistance! – Kobus Myburgh Aug 13 '19 at 11:39
  • Hope you find a solution! – tonsteri Aug 13 '19 at 11:43