View Full Version : [kubuntu] Apache2 running but can't view

March 15th, 2010, 12:45 AM
I have had a LAMP setup on my computer for a while without any trouble but I have suddenly become unable to access it through either localhost or my IP address. I have tried removing and reinstalling the packages but it still doesn't work and the /var/log/apache2/error.log does not give me any errors.

Here is my apache2.conf


Any help is appreciated.

March 15th, 2010, 05:12 AM
Check /etc/apache2/ports.conf - make certain Apache is listening.

Also, how do you know Apache is running (? ps -A ?)

March 15th, 2010, 06:32 AM
I have it listening on 80.

I know it is running because

scott@scott-desktop:/$ sudo apache2ctl start
httpd (pid 31216) already running

Ryan Dwyer
March 15th, 2010, 09:18 AM
You might have a firewall blocking the traffic so you can't even connect to it yourself. Or maybe your lo interface isn't functioning.

Try running these commands:
ping localhost
telnet 80

March 15th, 2010, 02:11 PM
sudo /etc/init.d/apache2 restart
sudo netstat -tlnp
sudo iptables -n -L INPUT
nc -z -v -w 5 80
echo -e "HEAD / HTTP/1.0\n"|nc 80

March 15th, 2010, 05:27 PM
Thanks everyone for the input. I was unable to ping my localhost but I flushed iptables and it works now:

iptables -F

Is this just a temporary fix or a permanent fix?