apachepermissionsapache2osx-mavericksdocument-root

OSX Mavericks Apache "DocumentRoot must be a directory"


I wanted to change the default document root for some local development on my new machine.

I edited httpd.conf and changed the DocumentRoot declaration to "Documents/Sandbox" and made sure the Sandbox directory has the correct permissions (777).

Further down in httpd.conf I edited another line to read .

So basically I replaced all original DocumentRoot declarations and replaced them with "Documents/Sandbox".

Now whenever I try to run Apache I get the infamous "Documentroot must be a directory" error.

I tried different variations of the DocumentRoot such as with and without a trailing slash, with a home directory declaration (~), adding "Users/me/", ... anyway it doesn't work.

Is what I am trying to do possible (ie having my DocumentRoot in a folder under "Documents" on my machine" and if so how do I go about correct this error?


Solution

  • I had the same problem. I was missing the first "/"

    IE: /Users/me/Documents/Sandbox