-1

I'm writing a website that I'm having some trouble getting online with a Debian server using Apache2. When I run the site on port 8080 (i.e. www.example.com:8080), the whole thing runs fine and the page is loaded. However, when I tell Apache to use port 80 instead, it doesn't work. When I visit it (i.e. www.example.com), it just seems to load endlessly.

I made sure that port 8080 was changed to port 80 in both /etc/apache2/ports.conf and /etc/apache2/sites-enabled/mysitesfile. I also made sure to restart the apache server after doing this: afterwards, Nmap showed Apache listening on port 80.

I determined earlier that both port 80 and port 8080 were indeed open on the server. So what gives? So long as both port 80 and port 8080 are open, what could be causing a problem where it works on one but not the other? Were there files that needed to be edited that I didn't edit?

Any help would be VERY much appreciated!

zeptonaut
  • 135
  • 1
  • 1
  • 3
  • can you confirm three-way traffic with: tcpdump -i INSERTINTERFACENAMEHERE port 80? Also, is HostnameLookups Off in the httpd.conf file? – Rilindo Dec 23 '11 at 21:59
  • The result of the tcpdump command was: `tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth3, link-type EN10MB (Ethernet), capture size 65535 bytes`. Was that what you were looking for? Also, /etc/apache2/httpd.conf appears to be completely empty. – zeptonaut Dec 23 '11 at 22:07
  • Okay, I forgot, this is Debian. Look at apache2.conf. However, assuming that you are listening on the port that your IP is attached, this suggest that traffic is not evening coming through in the begin. Can you run that in another window and then do a nc -z localhost 80? – Rilindo Dec 23 '11 at 22:12
  • You may want to consider testing something that's not port 80. @chakram88's answer is probably the most likely to be right given what we know, but trying to connect on port 81, 82, etc., might give you more information as to rather the problem lies on your server, network, or ISP. – Andrew M. Dec 24 '11 at 03:43
  • Troubleshoot. Does `netstat` show Apache listening on port 80? What IP is it bound to? Can you `telnet` to port 80 from the local machine? From a remote machine? – David Schwartz Dec 24 '11 at 04:08
  • @Rilindo HostnameLookups is indeed off. Running `nc -z localhost 80` with the tcpdump didn't result in any output from tcpdump. @Redmumba I took your suggestion and tried both ports 81 and 82 - neither of them worked. However, when I tried a completely random port (9979), it worked perfectly. @DavidSchwartz The only mention I see of port 80 in `netstat` is `tcp6 0 0 :::80 :::* LISTEN` - which doesn't mention Apache. I'm able to telnet to port 80 from the local machine, but not a remote machine. – zeptonaut Dec 24 '11 at 07:43

1 Answers1

0

Where is the server located?

If you are running this server at home, your ISP may be blocking port 80.

lhagemann
  • 268
  • 1
  • 8
  • Nope, the server is running at school (a .edu domain). Is there any way to check from a remote computer whether the port is blocked by some intermediary? – zeptonaut Dec 23 '11 at 22:08
  • Yeah. Can you connect to the site within the same network on port 80, then try again from a system outside your router/firewall. If it works inside the same subnet but not outside, then something between is blocking it. – Bart Silverstrim Dec 23 '11 at 22:21
  • Or, since it's a .edu (college?) you contact their IT department and ask if they're blocking the port. Is this running from a dorm? If so, then it's absolutely no surprise they'd block it. Students abusing network access is a huge problem for EDU's... – Bart Silverstrim Dec 23 '11 at 22:22
  • You can work out where it's firewalled with tcptraceroute (tracing on port 80) – tumbleweed Dec 24 '11 at 00:41
  • The preferred method is to `telnet 80`, which will open up a raw connection to the port--this doesn't rely on an existing service being setup. – Andrew M. Dec 24 '11 at 03:42
  • @BartSilverstrim Unfortunately, I have no other computer inside the network that I have root privileges for, and none of the other computers have telnet installed =/. The server isn't being run from within the dorms (I know they'd frown upon that!) - it's inside the CSE department. @tumbleweed From the looks of `tcptraceroute`, the packet is making it there - the final line of output is `2 myserver.cse.school.edu (12.3.45.6) [open] 0.196 ms 0.091 ms 0.101 ms` - very frustrating! – zeptonaut Dec 24 '11 at 07:48
  • You don't need root privileges to open a web browser and bring up a standard web page... – Bart Silverstrim Dec 24 '11 at 14:37
  • @BartSilverstrim Ahhh, great point! I've become a little too fixated on those command line tools... and you're absolutely right! It works like a charm within the network, but outside it's no good. I'll try and email the sysadmins and see if they know what's blocking it. Thanks! – zeptonaut Dec 24 '11 at 17:45