Recently I switched over to Apache on Mac Os X Mountain Lion. I had some trouble getting it to run correctly, because I was copying a configuration from another old installation of Linux. In this brief article, I will show you how to get it up and running if running it is not going as expected.
To see startup errors with Apache on Mac Os X, type:
$ sudo /usr/sbin/httpd
If any startup errors occur, it will show you in the terminal. If none occur, you can check if the httpd process has started correctly by typing
$ ps -ef | grep httpd .
If you still see the httpd running correctly, then Apache is doing fine. When it runs, kill it again by using the
kill command and relaunch Apache correctly with
$ sudo apachectl start.
There is no httpd process, but the above command does also not show any errors!
This means you are making progress. Check the error.log, specified in your httpd.conf probably. It will tell you how to resolve the last bit before you can finally launch Apache.
Now you are all done and able to use your Apache. Go try it out 🙂