If your apache and httpd running but you are not able to see your website then follow this method to get working. This is tested on CentOS 6.5.
There are several possibilities.
– firewall, iptables configuration
– apache listen address / port
If the issue is with the firewall/iptables, you can add the following lines to /etc/sysconfig/iptables:
1 2 3 4 | -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT |
Note: Second line is only needed for https
1 2 3 | # vi /etc/sysconfig/iptables |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT ~ |
Make sure this is above any lines that would globally restrict access, like the following:
1 2 3 | -A INPUT -j REJECT --reject-with icmp-host-prohibited |
And finally restart the iptable service.
1 2 3 4 5 6 7 8 | # service iptables restart iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] iptables: Applying firewall rules: [ OK ] |