How would I change the DocumenRoot on the version of Apache that came pre-installed on my Mac OS X s

Posted by racl101 on Server Fault See other posts from Server Fault or by racl101
Published on 2010-05-11T17:59:35Z Indexed on 2010/05/11 18:04 UTC
Read the original article Hit count: 193

Filed under:
|
|
|

OK, so I want to take advantage of the Apache server that comes installed on my Mac OS X system (which means, I would like not to have to install my own version of Apache since I might as well tryto use what comes bundled), and as such, I went to change some settings in the configuration file:

/etc/apache2/httpd.conf

Namely, I changed the these two lines:

DocumentRoot "/Users/myusername/Sites"

<Directory "/Users/myusername/Sites">

So that they initially pointed to a folder in my Dropbox folder (so I could have my docs sync to my Dropbox):

DocumentRoot "/Users/myusername/Dropbox/public_html"

<Directory "/Users/myusername/Dropbox/public_html">

That didn't work. So then I figured, ok maybe it was too much to ask to make folder in my Dropbox be my document root. So then I thought, what if I make the Document root another folder of my choosing like so:

DocumentRoot "/Users/myusername/dev-sites/public_html"

<Directory "/Users/myusername/dev-sites/public_html">

and that didn't work either. After looking within the httpd.conf file for clues it seems that only two directories appear to work as Document root paths for the Apache that comes bundled with Mac OS X:

/Users/myusername/Sites  (or ~/Sites)

and

/Library/WebServer/Documents/

But trying to use any other directories didn't seem to work. I would get 403 errors on my browser. I was wondering if there was some other settings to change on the httpd.conf file or any permissions to set to make this work.

Any help would be appreciated and many thanks in advance.

© Server Fault or respective owner

Related posts about apache

Related posts about macosx