I upgraded to Mountain Lion (10.8.x) from Lion (10.7.x) a few months ago, and only discovered today that Apache wasn’t working–going to http://localhost showed the default “It works!” page.
A quick search for “apache mountain lion” found this helpful guide: AMP Guide for Mac OSX 10.8.
tl;dr; for those who know what they are doing:
- There is no longer a Web Sharing section in System Preferences > Sharing.
sudo httpd start|stop|restartto control the Apache process
- Main configuration file:
- Enable PHP by uncommenting the PHP module include in
- User configuration file: create one at
Sample user conf contents:
<Directory "/Users/YOURUSERNAME/Sites/"> Options Indexes MultiViews FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>