In Mountain Lion the Sharing preference panel under System Preferences no longer provides a Web Sharing service configuration option. Nevertheless, the OS still includes an Apache web server that provides the same capabilities that existed in Lion to host both computer and personal websites.
Steps to configure and start the Apache web server under Mountain Lion have been documented in various places. But, those steps are not enough in order to enable personal websites when running the OS X Server application under Mountain Lion.
OS X Server stores the Apache web server configuration files in /Library/Server/Web/Config/apache2. By default the web server is not set to load the personal website configuration files stored in /etc/apache2/users. The following steps describe the change necessary to restore this functionality. These instructions assume some familiarity with OS X’s Terminal, the vi editor, the ability to execute commands as an administrator using sudo from the user account, and the existence of at least one properly configured personal website folder (ex. /Users/cmsantia/Sites with an index.html file or equivalent in it) and its corresponding configuration file in /etc/apache2/users (ex. cmsantia.conf).
- Open a Terminal window and go to the directory that contains the web server’s configuration file using the following command:
- In the Terminal window, edit the httpd_server_app.conf file using the following command and entering the appropriate password when prompted:
sudo vi httpd_server_app.conf
- In the httpd_server_app.conf file, look for the line that reads #Include /private/etc/apache2/extra/httpd-userdir.conf and uncomment it by removing the # character in front of it.
- Save and close the httpd_server_app.conf file after making the change.
- Open Websites under the SERVICES node on the left panel of the OS X Server application and restart the web server by turning the service OFF and then ON again.
- Open the personal website’s URL in Safari (ex. http://localhost/~cmsantia) and verify that it comes up without problems.