Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Control a custom Apache install via the Sharing panel' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Control a custom Apache install via the Sharing panel
Authored by: temhawk on Sep 05, '12 07:42:43PM

A bit late here, but in case anyone is wondering. I'm on 10.6.8 and I found that this tip is completely irrelevant. (Note: My Apache version is 2.2)

All you need to do is these simple steps:

  1. Turn OFF Web Sharing using the System Preferences app
  2. Open the following file with your favorite text editor (it must be able to save as root!):
    /System/Library/LaunchDaemons/org.apache.httpd.plist
  3. Change the part that says
    /usr/sbin/httpd
    to the path where your httpd binary is. I changed mine to
    /usr/local/apache2/sbin/httpd
  4. Save
  5. Turn ON Web Sharing using the System Preferences app
You may want to copy and back up the original org.apache.httpd.plist file first before making any changes.

And for your information: instead of using the System Preferences app, you can do the same using a few simple terminal commands.

To start the server:

cd /System/Library/LaunchDaemons
sudo launchctl load -w org.apache.httpd.plist

To stop it:

cd /System/Library/LaunchDaemons
sudo launchctl unload -w org.apache.httpd.plist

The above will only work if you use the sudo command.

Finally, you can see if the server is running using this last useful command (or just look in Activity Monitor):

ps -Aco 'pid user comm' | grep httpd

The result should look something like this.



[ Reply to This | # ]