Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I had Apache working on my 10.8 MPBR. I haven't used it for a few weeks, and now it doesn't seem to start. I get nothing in /private/var/log/apache2. Nothing, meaning no logging at all, error or otherwise. Permission on the log folder is drwxr-xr-x root wheel

I have tried all ways of starting, stopping, and restarting apache. I have checked for activity on port 80, there is nothing happening.

Configtest is Syntax OK. I have not fiddled with apache in any way in the time between now and when it was last working.

I do get a 'weird reason' error in the console.

1/17/13 8:47:34.592 PM com.apple.launchd[1]: (org.apache.httpd) Throttling respawn: Will start in 10 seconds
1/17/13 8:47:44.594 PM com.apple.launchd[1]: (org.apache.httpd[22855]) Job failed to exec(3). Setting up event to tell us when to try again: 2: No such file or directory
1/17/13 8:47:44.594 PM com.apple.launchd[1]: (org.apache.httpd[22855]) Job failed to exec(3) for weird reason: 2
1/17/13 8:47:44.594 PM com.apple.launchd[1]: (org.apache.httpd) Job should be able to exec(3) now.

The 'No such file or directory' bit is suspicious, but don't know what file/dir is missing. My next move will be to try and start from a plain vanilla setup and see if that works.

I'd rather not install MAMP, I only need the web server, so hopefully I can figure out what got borked.

Anyone know how to get better debugging on what the Console is on about?

Anyone care to guess what might have gotten out of whack?

share|improve this question
    
Did you try "sudo apachectl graceful" to restart? –  soxman Jan 18 '13 at 21:30
    
Show us the end of the /var/log/apache2/error_log please? –  maksimov Jan 19 '13 at 1:13
    
As mentioned above "I get nothing in /private/var/log/apache2". I mean nothing, like no output of any kind. –  tehfoo Jan 22 '13 at 20:26
    
@soxman no form of starting, stopping, or restarting helps. Apache seems to not respond in any way. Edited above to reflect this. –  tehfoo Jan 22 '13 at 20:27
    
Edited above to add more detail, some in response to questions –  tehfoo Jan 22 '13 at 20:34

5 Answers 5

up vote 2 down vote accepted

I had exactly the same problem. I started Apache without DocumentRoot(s). It did the trick.

sudo apachectl -T
share|improve this answer
    
That first gave me an error/warning httpd: Could not reliably determine the server's fully qualified domain name, using sinisterkid.local for ServerName. I think setting ServerName in the httpd.conf file will fix that. Now Apache seems to be running... but won't stop. –  tehfoo Feb 21 '13 at 23:52
    
About my case, I realize that I completely forgot about web sharing on mountain Lion. I installed this plugin : clickontyler.com/blog/2012/02/web-sharing-mountain-lion but It was off... –  clempat Feb 28 '13 at 13:14
    
Check as well this : blog.joshdick.net/2012/07/28/… and try sudo apachectl -k start –  clempat Feb 28 '13 at 14:34
    
I'm accepting the -T answer, but I'm not convinced that's what actually got it working again. When I tried -T the server started, and I couldn't shut it down again no matter what, apache kept respawing processes no matter what I did. I did a reboot with the launch daemon loaded and now it seems to be working fine. So weird. –  tehfoo Mar 7 '13 at 18:54
    
You saved my day. Thanks a lot :-) –  Abhay PS Jul 21 at 12:31

I've had similar issue with apache and I found our what was wrong (and in which config file) with this command:

sudo apachectl configtest

I found out about this from this forum post about apache issues.

share|improve this answer

I've seen similar just today, no logs and apache acted like it was started. The issue for me was a bad vhost file.

sudo apachectl -S this allowed me to see the error

share|improve this answer
    
This does not really answer the question. If you have sufficient reputation, you may upvote the question. Alternatively, "star" it as a favourite and you will be notified of any new answers. If you have a different question, you can ask it by clicking Ask Question with a link to this question if it helps provide context. –  grgarside Feb 13 at 17:55

Have you installed/upgraded ruby? check out your org.apache.httpd.plist , see if you got http-wrapper there. if so it may be issue with ruby binary. check your paths and soft links again.

share|improve this answer
    
Why would Ruby be the cause of apache not starting? –  Tonin Mar 15 '13 at 2:05
    
Because Apache on 10.8 is started by httpd-wrapper, a ruby script. According to this StackOverflow post, replacing your system ruby version can cause issues with it. –  Eric3 Apr 26 '13 at 2:52

The logs are by default in /var/log/apache2/ and not in /private/... if you haven´t changed it you can also use Launchpad=>Utilities=>Console to look in it.

share|improve this answer
2  
/var/ is a symlink to /private/var/. –  ؘؘؘؘ Jan 19 '13 at 1:46
    
Yes, you are right, that it is a symlink ... but the world could be less complicated to open the console app (why we should not use it if it is already there) and look in /var/log instead to make a expedition through /private/var/log/apache2/ to look in some apache logs. –  NaWi at Mac Jan 19 '13 at 9:42

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.