I installed Apache 2.2 using Homebrew on OSX 10.9 and it was working fine until I upgraded to Yosemite this weekend.

sudo apachectl start
ps aux | grep httpd
ps aux | grep apache
sudo /usr/local/Cellar/httpd22/2.2.27/bin/httpd -k start
They all return nothing.

sudo apachectl returns:

Usage: /usr/local/Cellar/httpd22/2.2.27/bin/httpd [-D name] [-d directory] [-f file]
                                              [-C "directive"] [-c "directive"]
                                              [-k start|restart|graceful|graceful-stop|stop]
                                              [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S]

Any idea what file I could look at to see if there is any error? MAMP Pro seems to have similar issue which is fixed by renaming envvars to _envvars. I tried it and it didn't work.

Please let me know if you need more details.


I should have done this first but I finally took a look at /usr/local/var/log/apache2/error_log and I saw this:

[Tue Jan 27 14:56:07 2015] [error] (2)No such file or directory: could not create /usr/local/var/run/apache2/httpd.pid
[Tue Jan 27 14:56:07 2015] [error] httpd: could not log pid to file /usr/local/var/run/apache2/httpd.pid 

Obviously that was the issue... I created the folder /usr/local/var/run/apache2/ and voilà!

  • 1
    Would really like to know the root cause of why we need to do this – chrisortman Apr 17 '15 at 14:23

Try this,

brew update    

brew doctor    

brew reinstall php53 --with-mysql --with-pgsql --with-apache    

sudo apachectl -k restart    

If you want you can see the complete post here:


  • Thanks Jorge for the comment. I should have said that I already tried that (well, not reinstalling the whole thing 'cause I think it wasn't necessary) as this was the first result on Google. – Kev Jan 27 '15 at 20:01
  • I also have an issue with Yosemite and I resolve it with brew doctor. As you wrote, take a look to the logs file should be the first thing to do. – Jorge Buchmann Jan 27 '15 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.