Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question
    
Please provide the errors that are returned when you try to start the service. –  Shane Madden Sep 21 '12 at 21:33
    
start by doing an apache2ct -t to check the configuration. –  rbanffy Sep 22 '12 at 0:25

1 Answer 1

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.

share|improve this answer

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.