ID #1051

Change the document root for Apache2 on MacOS.

MacOS pre-intsalled Apache, therefore, in order for changes to take effects, we need to modify /etc/apache2/httpd.conf

You may have to modify the permisson for this file: chmod a+w httpd.conf

Change the DocumentRoot to the directory that you want your site files to go, and also change the <Directory "the_location_should_be_your_document_root"> ... </Directory>.

Then in the System Preference/Sharing, disable Web Sharing and enable it again.(The web server can also be started via command: sudo apachectl -k start or be stopped via sudo apachectl -k stop)

Refresh your web browser to http://localhost. You will see your new site, suppose that you put some index.html in your directory that you just set to.

Categories for this entry

Tags: apache, configuration, document, httpd, root

Related entries:

You can comment this FAQ