1

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.

2 Answers2

2

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.

womble
  • 96,255
  • 29
  • 175
  • 230
  • 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 00:36
0

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

phoebus
  • 8,380
  • 1
  • 31
  • 30