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 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
add comment

1 Answer

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
    
add comment

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.