Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have installed a couple of virtual machines. Some uder Windows, some under Fedora Linux. On one of the Fedora machined I've installed Apache web server.

I have setup server name in httpd.conf to 172.16.27.129:80, made sure the access to html directory is Allow from all, and populated that directory with test .html file. After starting httpd, I've got web server working locally.

Then I tried to access it from other machine and failed. Just getting 'Firefox can't establish a connection' message.

Error logs on server machine are empty. I thought it could be the firewall, so I made my iptables setup like this:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh 
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http state NEW,ESTABLISHED 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:https state NEW,ESTABLISHED 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:http state ESTABLISHED 
ACCEPT     tcp  --  anywhere             anywhere            tcp spt:https state ESTABLISHED 

Still no luck. I thought it could be something with the network. But I have a Subversion server working via HTTPS on one of my virtual Windows machines, so network should be fine.

At this point I've run out of ideas. What did I miss?

UPDATE: It has to be iptables. I just tuned it off and the whole thing works.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh 
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http state NEW,ESTABLISHED 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:https state NEW,ESTABLISHED 

The problem here is that both of the lines that have to do with HTTP and HTTPS traffic come immediately after the REJECT entry, which means that those rules aren't being seen at all. They need to be put into the IPTABLES configuration before the REJECT, otherwise they are going to be blocked.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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