Monday, March 2, 2009

Changing Mac OS X Web Server Root Directory

This is hardly the first post on the topic... but I'm documenting this more for my own sake than anyone elses.

First, create a backup of httpd.conf:

ditto /etc/httpd/httpd.conf /etc/httpd.conf.bak

Then open it in vi:

sudo vi /etc/httpd/httpd.conf

Find the line that reads:

DocumentRoot "/Library/WebServer/Documents"

Change it to something like:

DocumentRoot "/Volumes/Mac/Web"

Use something like this to confirm the changes in the file after saving:

more httpd.conf | grep DocumentRoot

1 comment:

Anonymous said...

Thank you. I was looking for this.

Favorites from my Blogroll