Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does localhost:8080 mean? [closed]

Tags:

url

networking

What is the difference between localhost/web vs. localhost:8080/web?

like image 864
whamsicore Avatar asked Jan 27 '11 22:01

whamsicore


People also ask

Why is my localhost 8080 not working?

Description. The server might be running at a different port number than expected, either because it was intentionally installed there, or because another server was already running on the default port when the server was installed.

Why my localhost is not working?

It is triggered if the firewall wrongly blocks your server or you're using the wrong port. The localhost error can also happen if your Apache web server or Chrome browser is not configured correctly.


2 Answers

A TCP/IP connection is always made to an IP address (you can think of an IP-address as the address of a certain computer, even if that is not always the case) and a specific (logical, not physical) port on that address.

Usually one port is coupled to a specific process or "service" on the target computer. Some port numbers are standardized, like 80 for http, 25 for smtp and so on. Because of that standardization you usually don't need to put port numbers into your web adresses.

So if you say something like http://www.stackoverflow.com, the part "stackoverflow.com" resolves to an IP address (in my case 64.34.119.12) and because my browser knows the standard it tries to connect to port 80 on that address. Thus this is the same as http://www.stackoverflow.com:80.

But there is nothing that stops a process to listen for http requests on another port, like 12434, 4711 or 8080. Usually (as in your case) this is used for debugging purposes to not intermingle with another process (like IIS) already listening to port 80 on the same machine.

Note from 2021: When I made this post, I used port 80 as example because even though the OP didn't specify a protocol, http was the usual web request standard back then and 80 ist the standard for http. Nowadays pretty much everything runs on https and the standard port for that is 443.

like image 169
TToni Avatar answered Oct 11 '22 10:10

TToni


localhost/web is equal to localhost:80/web OR to 127.0.0.1:80/web

localhost:8080/web is equal to localhost:8080/web OR to 127.0.0.1:8080/web

like image 44
nrph Avatar answered Oct 11 '22 11:10

nrph