The default location of Document root as per httpd.conf is /Library/WebServer/Documents
. I want this location to be /webcontent
. So to do that, I created a webcontent folder in root(/).
Then in the httpd.conf:
- Changed the Document root line to DocumentRoot
/webcontent
- Changed the Directory tag to
<Directory "/webcontent">
;
After restarting the Apache I'm getting the following page:
Forbidden
You don't have permission to access / on this server.
Could anyone please tell me whether I need to change any permissions anywhere else to change the document root?
The
httpd.conf
file provided with OS X has a default deny that locks down every directory from every client. It then allows access to theDocumentRoot
directory — that would be the default of/Library/WebServer/Documents
. Page down some in that file and you'll see:Change the
"/Library/WebServer/Documents"
bit to"/webcontent"
and you're good.To follow on from @Bred Ackerman answer if your using apache vhost you will need to add: private/etc/apache2/extra/httpd-vhosts.conf