Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apache and httpd running but I can't see my website [closed]

Tags:

I have installed apache on my server however I can not browse my website through my server's IP. the setup of the apache is a single account server under /var/www/htdocs/.

Is there anything else I need to do to be able to see the account via my server's IP?

like image 377
Ahoura Ghotbi Avatar asked Mar 30 '12 03:03

Ahoura Ghotbi


People also ask

Why is my Apache Web server not working?

There are several reasons your Apache server might fail to run. Something could be blocking the port it uses; there could be another instance of Apache already running; or there might be an incompatibility with the version of PHP you're using in MAMP.


2 Answers

There are several possibilities.

  • firewall, iptables configuration
  • apache listen address / port

More information is needed about your configuration. What distro are you using? Can you connect via 127.0.0.1?

If the issue is with the firewall/iptables, you can add the following lines to /etc/sysconfig/iptables:

-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT 

(Second line is only needed for https)

Make sure this is above any lines that would globally restrict access, like the following:

-A INPUT -j REJECT --reject-with icmp-host-prohibited 

Tested on CentOS 6.3

And finally

service iptables restart 
like image 97
Jacob Stoner Avatar answered Oct 06 '22 00:10

Jacob Stoner


Did you restart the server after you changed the config file?

Can you telnet to the server from a different machine?

Can you telnet to the server from the server itself?

telnet <ip address> 80

telnet localhost 80

like image 31
Deep Kapadia Avatar answered Oct 05 '22 23:10

Deep Kapadia