I've got a box running Ubuntu 10.04, and I have Apache2 installed. When I'm on the box I can go to http://localhost/ and it connects to the web server fine. I can also go directly to my IP and connect no problem. However, if I try to connect from another computer on the network, either through the DNS or direct IP, my connection times out.

However, I can connect to the box via SSH just fine, as well as ping the box.

Any ideas?

Thanks

UPDATE:

When running nmap on the local computer I get the following:

wayne@media-box:~$ sudo nmap -sS -O -PI -PT 192.168.1.70

Starting Nmap 5.00 ( http://nmap.org ) at 2010-06-28 06:32 CDT
Interesting ports on media-box (192.168.1.70):
Not shown: 995 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
25/tcp  open  smtp
80/tcp  open  http
143/tcp open  imap
993/tcp open  imaps

However, if I run it from another box on the network:

Starting Nmap 5.00 ( http://nmap.org ) at 2010-06-28 06:32 CDT
Interesting ports on media-box (192.168.1.70):
Not shown: 998 filtered ports
PORT    STATE  SERVICE
22/tcp  open   ssh
113/tcp closed auth

So 80 is open to the box itself but not the outside world? How do I fix that?

link|improve this question

60% accept rate
feedback

5 Answers

up vote 1 down vote accepted

Do you have any other firewalls installed?

  • Yes, shorewall

Well

# sudo apt-get remove shorewall

and that will fix it.

link|improve this answer
feedback

It definitely could be a firewall problem, but I couldn't tell you what might be wrong without seeing your firewall rules. You can run

iptables -L

to list them, and paste the output into your question if you need help interpreting it.

I've written an IPTables tutorial/reference (link is to my website) that might be useful. Part of it is a short guide to configuring the firewall on a Linux server, i.e. what commands to run, what rules to add, and in what order.

link|improve this answer
feedback

When accessing this box from local network, are you using the private or the public IP of the box?

When accessing from local network you should use one of the 192.168.XXX.XXX, 10.XXX.XXX.XXX or 172.16.XXX.XXX prefixes...

link|improve this answer
192.168.XXX.XXXX - it's the same IP I can successfully ping and ssh to, but for some reason port 80 is not connecting – Wayne Werner Jun 28 '10 at 11:29
if you're using iptables, post here the output of iptables -L -v please – poscaman Jun 30 '10 at 19:17
feedback

It's possible that something enabled Ubuntu's built-in (but usually disabled by default) firewall, ufw. Try running:

$ ufw status

If ufw is enabled, and you want to disable it, run ufw disable. If you want to leave the firewall enabled and whitelist HTTP traffic, run ufw allow Apache

link|improve this answer
It's disabled :-\ – Wayne Werner Jun 30 '10 at 2:56
feedback

Run this from the CLI and then try to connect from a remote computer:

$ iptables --flush

If it works, then you need to allow incoming traffic on port 80 (and possibly 443) to get through the firewall.

link|improve this answer
Nope... now I can't ssh in, either. – Wayne Werner Jun 28 '10 at 3:51
3  
ooooh... bad idea. Flushing IPTables deletes all the rules, and if you don't have the default policy set to ACCEPT you'll be locked out. – David Zaslavsky Jun 28 '10 at 5:39
good thing my server is at home... – Wayne Werner Jun 28 '10 at 11:41
Gah, sorry about the bad info. – ErikA Jun 28 '10 at 15:33
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.