Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Apache installed on OS X and I want to know what command I can use to:

  • start apache
  • stop apache
  • restart apache
  • gracefully restart apache

Also I want to know if the commands were successful or not.

Apache seams to be installed as org.apache.httpd or at least this is what sudo launchctl list|grep apache shows.

share|improve this question
Not sure why but launchctl stop org.apache.httpd doesn't do anything but service stop org.apache.httpd seems to work even if it does warn me that I should use launchctl instead. – sorin Jun 30 '11 at 9:26
If your apache has launchd configuration files, then you would have to load and unload the org.apache.httpd to affect launchd control over the app. Are you using the built in apache or installing it yourself? – bmike Jun 30 '11 at 21:24

I use the apachectl command

sudo apachectl stop
sudo apachectl start
sudo apachectl restart
sudo apachectl -k graceful

Hope this helps

share|improve this answer
This doesn't work on Lion. – vy32 Aug 29 '11 at 13:58

Your Answer


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.