Debian – Can’t start apache2 on Debian Squeeze

apache-2.2debian

I installed apache with apt-get install apache2 then tried wget localhost and got:

--2012-09-21 23:12:29--  http://localhost/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... failed: Connection refused

Then I tried /etc/init.d/apache2 status and sure enough, apache2 wasn't running but it still wouldn't start the service if I do /etc/init.d/apache2 start.

Any help is appreciated!

Best Answer

You need to configure Apache.

1) Edit the default vhost to point at your docroot

2) Edit the Listen lines to bind to the appropriate interface.

3) If you're binding to port 80, it needs to be started as root.

Check /var/log/apache2/error_log for the relevant error.

Related Topic