LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Cant connect on port 80 (https://www.linuxquestions.org/questions/linux-networking-3/cant-connect-on-port-80-a-108527/)

slackwarefan 10-25-2003 09:27 PM

Cant connect on port 80
 
Hello

I can connect to my local machine from my local machine, but when others try to connect from their computers, they get a timeout error on http. I am running apache, and I checked the logs but they dont report any attemped access. Why does this happen and how do I fix it?

Blindsight 10-25-2003 11:05 PM

You shouldn't have any firewall rules, but let's check anyway.

`iptables -L -n` ... Paste your output unless it's empty. It should just say INPUT, OUTPUT, and FORWARD with nothing listed under it.

Secondly, how do you connect to the internet? Dialup? Cable? If you have a cable modem, it's likely that your cable modem things people are trying to connect to it from the outside, so you have to forward port 80 from your cable modem to your linux box.

Next, `netstat -an | grep 80`. What interfaces are listening on port 80 on your machine? It should be listening on either 0.0.0.0:80 or 127.0.0.1:80 AND <ethx ip>:80 . If that isn't the case, go to your httpd.conf and make sure your "Listen" directive just says "Listen 80" instead of "Listen 127.0.0.1:80".

Hope this helps, post your results.

aeruzcar 10-25-2003 11:07 PM

Doy you have a modem or a router connected to your computer?, if so, make sure that you have forwarded the port to your computer.

slackwarefan 10-25-2003 11:53 PM

port 80
 
output of iptables:

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Also, if I am using a cable modem. how do I foreward port 80 to my linux box, and why does it already do this with other ports? It is an RCA modem.

Here is the output of netstat

netstat -an | grep 80
unix 2 [ ACC ] STREAM LISTENING 1040 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1726 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1723 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1716 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1712 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1700 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1678 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1675 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1662 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1657 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1645 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1639 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1613 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1563 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1483 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1470 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1449 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1444 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1438 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1428 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1418 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1410 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1387 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1384 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1366 /tmp/.ICE-unix/dcop980-
1067143319
unix 3 [ ] STREAM CONNECTED 1345 /tmp/.ICE-unix/dcop980- 1067143319
unix 3 [ ] STREAM CONNECTED 1339 /tmp/.ICE-unix/dcop980- 1067143319
unix 3 [ ] STREAM CONNECTED 1294 /tmp/.ICE-unix/dcop980- 1067143319
unix 3 [ ] STREAM CONNECTED 1290 /tmp/.ICE-unix/dcop980- 1067143319
unix 3 [ ] STREAM CONNECTED 1274 /tmp/.ICE-unix/dcop980- 1067143319
unix 3 [ ] STREAM CONNECTED 1230 /tmp/.ICE-unix/dcop980- 1067143319
unix 3 [ ] STREAM CONNECTED 1207 /tmp/.ICE-unix/dcop980- 1067143319
unix 3 [ ] STREAM CONNECTED 1199 /tmp/.ICE-unix/dcop980- 1067143319
unix 3 [ ] STREAM CONNECTED 1185 /tmp/.ICE-unix/dcop980- 1067143319
unix 3 [ ] STREAM CONNECTED 1154 /tmp/.ICE-unix/dcop980- 1067143319
unix 3 [ ] STREAM CONNECTED 1075 /tmp/.ICE-unix/dcop980- 1067143319
unix 3 [ ] STREAM CONNECTED 1060 /tmp/.ICE-unix/dcop980- 1067143319

chort 10-26-2003 01:49 AM

Well it could be several problems. As mentioned above, there might be a firewall in the way (nope), or your http server might not be bound to (listening on) the Internet interface. The output above shows only UNIX sockets, so that's possible. To clean up the output a little use netstat -anA inet. Just paste all the output of that command (no grep).

Now if you connect to the Internet via a cable modem, it's quite possible that your ISP is actually blocking inbound HTTP requests. You mentioned that your friends are getting time-out errors, which means somewhere a firewall is silently dropping packets. If it was your computer not listening on the right port they would get a connection refused instead of time-out.

You are probably going to end up needing to use a non-standard port for your HTTP server, which will make the normal method of connecting to it not work (well, it doesn't work now any way, so no big loss). You could use a "web-hop" service to redirect all HTTP requests at your site to your custom port. I know that dyndns.org offers such a service.

Blindsight 10-26-2003 03:31 AM

Excellent post by chort.

I'm not a GUI guy, so netstat -an doesn't give me a buttload of UNIX sockets, so I suggest it to people as habit cause I do it myself. chort had a better method. Try that first, to clean up your output and see if you have a http service running.

To forward ports from your cable modem, most modems have an admin console or http access. Read the man on your modem to find out how to access it and how to forward ports from it. If you don't have the printed documentation, in most cases Google can provide it for you.

To find out for sure if your ISP is filtering out inbound port 80 requests to their clients, it's best to call them and ask. Some ISPs find this an efficient way of blocking www servers running off their pipe (why?). chort offers an effective way of getting around that.


All times are GMT -5. The time now is 12:40 AM.