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.

Thanks.

link|improve this question

feedback

2 Answers

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
</Directory>

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.

link|improve this answer
It says [Sun Dec 20 16:30:07 2009] [error] [client 127.0.0.1] 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
feedback

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

link|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
1  
Glad to see you got it worked out:) – phoebus Dec 21 '09 at 0:45
feedback

Your Answer

 
or
required, but never shown

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