Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Hey guys, I'm running Mac OS X 10.6 Snow Leopard with the default Apache 2 installation that it comes with and PHP 5 enabled.

Anyways, I have configured a VirtualHost whose DocumentRoot is under /Users/blaenk/Sites. This works perfectly fine, but if I set it to a directory within my code directory, Users/blaenk/code/php/somesite, it gives me the Forbidden error. Apparently this has to do with permissions on the folders, as they are different:

drwxr-xr-x+  6 blaenk  staff   204B Dec 20 16:09 Sites/
drwx------  15 blaenk  staff   510B Nov 28 18:35 code/

I tried making the code, php, and somesite directories all 755, but that did not seem to solve the issue. I also did chmod -R 755 ~/code/php/blaenkdenum , to no avail.

I would appreciate any help which you guys can provide. Let me know if I'm missing any information.


share|improve this question

2 Answers 2

up vote 2 down vote accepted

Check your error log for details of exactly why access was forbidden; it can be because of filesystem permissions, but it can also be because of Apache path permissions -- if the Apache config has something like:

<Directory /Users/*/Sites>
  allow from all

But nothing equivalent for /Users/*/code, then Apache won't allow HTTP access to your vhost location, regardless of what the filesystem permissions might be.

share|improve this answer
It says [Sun Dec 20 16:30:07 2009] [error] [client] client denied by server configuration: /Users/blaenk/code/php/blaenkdenum/, so I'm guessing it is indeed a configuration issue. I went ahead and added a Directory block to allow traffic to that path and it fixed the issue, thanks :) – Jorge Israel Peña Dec 21 '09 at 0:36

Make sure the permissions on the files you are trying to serve are 755 as well, not just the directory.

share|improve this answer
Yep, I did chmod -R 755 ~/code/php/blaenkdenum, restarted apache, still Forbidden. – Jorge Israel Peña Dec 21 '09 at 0:30
Glad to see you got it worked out:) – phoebus Dec 21 '09 at 0:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.