Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm having a problem with apache2 server today. I just wont respons for localhost but it says it's started.

Env: Mac OSX.

I'm listening on 80 as specified in /private/etc/apache2 lines 51-53.

<IfDefine !MACOSXSERVER>
Listen 80
</IfDefine>

It seems my configuration is fine, I think:

$ httpd -v
Server version: Apache/2.2.22 (Unix)
Server built:   Jul 12 2012 15:11:26

$ httpd -t
httpd: Could not reliably determine the server's fully qualified domain name, 
using Firemac.local for ServerName
Syntax OK

When trying to do

sudo apachectl restart

There is no error, and when I try

sudo apachectl start

I get

org.apache.httpd: Already loaded

127.0.0.1 and localhost do not respond. If I:

 $ lsof | grep LISTEN

or:

 $ netstat -l | grep http

There is nothing on port :80 listening, and if I:

 ps ax | grep httpd | grep -v grep

I get nothing.

share|improve this question
1  
Does GET<enter><enter> with netcat 127.0.0.1 80 return anything? If so, try with localhost instead of 127.0.0.1 as well. Please share your complete configuration file if possible. –  zmode Oct 15 '12 at 8:13
    
@zmode I just fixed it by rebuilding the config file from the default one and restarting the server at each changed line. The problem was in the vhosts file where I had foo1.dev.bar.com and foo2.dev.bar.com in two different virtual hosts directives - this is the way it should be. I just commented out the foo2.dev.bar.com alias and it worked. Not sure why... –  Vlad Nicula Oct 15 '12 at 8:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.