How do I start/stop Apache from Terminal?
I'm probably making this harder for myself than it has to be, but I'd like to know how to start, stop, or restart Apache from Terminal. I've googled for this command and found the following:
sudo apachectl restart graceful (this simply gives me a reference to the commands I can run, but doesn't seem to do anything)
sudo apachectl -k start
sudo apachectl -k stop
the second two actually work, however I get a 404 not found error. Checking the error log (/private/var/log/apache2/error_log) reports the following:
[Sat Jun 02 00:18:50 2012] [error] [client ::1] File does not exist: /usr/htdocs
I'm confused as to why it's looking in /usr/htdocs when the DocumentRoot is defined as "/Library/WebServer/Documents"
As a note, my server does work normally if I turn web sharing on/off from System Preferences (that is, if i forcefully stop all httpd processes in Activity Monitor and then toggle Web Sharing off/on). But I'd like to know how to avoid using using that option (even though I may rarely have a need to start/stop or restart my local server)
MackBook Pro, Mac OS X (10.5.2)