django/apache permissions problem
I'm running a django project on Centos 5.4 and serving it with httpd/mod_wsgi. I can't figure out the correct permissions for /home/website/django_project so that I don't get a 403 error.
In my httpd.conf the user and group to run httpd as is apache. The group django is set up with website and apache as members. The owner of /home/website and all subdirs is website:django, and the permissions are rwxrwx---. Right now the project works fine with the dev server, but if I try to view it through apache, I get a 403 error. chmod -R o+rx /home/website/django_project fixes the开发者_Python百科 problem, but this obviously isn't a good solution.
Thanks
First, try setting the group-sticky bit on the directories:
find /home/website -type d -exec chmod g+s {} \;
Then the perms should read rwxrws---
. See if this makes a difference.
If that fails, you can try to poke around as the "website" user and see what happens. Temporarily give the user "website" a home directory (not /home/website, it needs to be something else, like /var/home/website), password, and login shell, then use su - website
to switch to it. Try listing the contents of /home/website and try reading files in there. Fix any problems.
Hope this helps.
P.S. I'm assuming /var/log/apache/access_log
(or maybe it's /var/log/http/access_log
) doesn't have anything useful.
精彩评论