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

How can I recover the apachectl on my OSX?

I deleted it, somehow, and now the command apachectl doesn't exist anymore.

share|improve this question

migrated from Jan 31 '13 at 3:09

This question came from our site for system and network administrators.

Do you... have any backups? use Time Machine? have the 10.8 install media? – jscott Jan 31 '13 at 1:50
/usr/sbin isn't in your PATH usually. What does ls -l /usr/sbin/apachectl return? – patrix Jan 31 '13 at 6:44
@jscott I have a Macbook Pro, there is no install media, and no, I don't use Time Machine, at least until it happened. – Daniel Ribeiro Jan 31 '13 at 10:31
@patrix returns ls: /usr/sbin/apachectl: No such file or directory – Daniel Ribeiro Jan 31 '13 at 10:32
@patrix In lieu of building apache from Apple's source, it may be quicker to find another 10.8 user and get a copy from them. – jscott Jan 31 '13 at 12:01
up vote 2 down vote accepted

On 10.8 apachectl is a ~50 SLOC shell script. I uploaded the one from my installation here. For example apachectl start just runs (sudo) launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist, so you don't necessarily even need apachectl.

share|improve this answer

If you build Apache httpd from the source code, you can get the apachectl binary from <apache_src_dir>/support/apachectl.

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Welcome to Ask Different! Can you please elaborate the answer to explain how one can rebuild apache from source? – patrix Feb 25 '13 at 7:48

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.