FAQ: 403 Forbidden Error
If you're getting a 403 Forbidden error when trying to access your virtual hosts, here's how to solve it.
What directory are your website files stored in? By default, the version of Apache that comes with OS X expects all of your websites to be in folders inside
/Library/WebServer/Documents
If you're storing them in your local Sites folder (e.g. /Users/<your-user-name>/Sites) you'll need to edit your Apache config file to let it know about the change. In Leopard that file is
/private/etc/apache2/httpd.conf
Open that file in a text editor and look for the following two lines:
DocumentRoot "/Library/WebServer/Documents"
-and a few lines below it-
<directory>
Change the directories to match where you store your websites, save the file, restart your Mac, and (hopefully) that'll fix the problem.
If you're still running into issues or have any other questions, just let us know.</your-user-name>
What directory are your website files stored in? By default, the version of Apache that comes with OS X expects all of your websites to be in folders inside
/Library/WebServer/Documents
If you're storing them in your local Sites folder (e.g. /Users/<your-user-name>/Sites) you'll need to edit your Apache config file to let it know about the change. In Leopard that file is
/private/etc/apache2/httpd.conf
Open that file in a text editor and look for the following two lines:
DocumentRoot "/Library/WebServer/Documents"
-and a few lines below it-
<directory>
Change the directories to match where you store your websites, save the file, restart your Mac, and (hopefully) that'll fix the problem.
If you're still running into issues or have any other questions, just let us know.</your-user-name>
2
people have this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
-
Inappropriate?I have the same problem.
My sites are not located in the default documentroot of OSX. They are scattered in my development folders. I am not able to get rid of the 403 error.
I hoped VirtualHostX could help me ...
I have a 13" MacBook Pro, Leopard 10.5.8 running the built in webserver
I’m sad
-
Inappropriate?Open up a Terminal window and run the following two commands.
chmod 755 ~
-and-
chmod 755 ~/Sites
That will reset the permissions on your user folder and Sites folder, which has worked for me in the past. -
Inappropriate?This needs better (thorough) documentation.
I've been using MAMP with sites fine in the htdocs folder. Saw this on MUPromo and thought I'd give it a try.
I'm getting 403 errors in the "virtual" directories, typed the chmod code above and now am getting 403 errors in my MAMP directories too.
Please advise.
I’m sad it's so confusing.
Loading Profile...


EMPLOYEE
