我在这里发现了一个类似的问题,但没有帮助我。Apache Django“客户端拒绝服务器配置”错误
我基本上在我的OS X上安装了apache。我也安装了Django。
然而,当我尝试通过浏览器本地加载页面时,我得到:
Forbidden
You don't have permission to access/on this server.
我有使虚拟主机的唯一修改原来的httpd.conf中,我有:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/Dropbox/project/www/"
ServerName touch.loc
# ServerAlias www.dummy-host.example.com
ErrorLog "/Dropbox/project/www/log/error.log"
CustomLog "/Dropbox/project/www/log/access.log" common
</VirtualHost>
而且error.log文件给出:
[Tue May 03 20:22:56 2011] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /Dropbox/project/www/
我看了四周,看起来升IKE我必须添加以下到httpd.conf:
<Directory /Dropbox/project/www >
Order deny,allow
Allow from all
</Directory>
在这种情况下,我得到:
[Tue May 03 20:27:55 2011] [error] [client 127.0.0.1] client denied by server configuration: /Dropbox/project/www/
有人可以帮我解决这个烦恼?我如何进一步调查? 它与用户/组有关吗?
更新: 然后我添加了选项+索引和打开的权限。但是,当我尝试加载页面时,出现的文件结构而不是wsgi文件来拾取和加载网站。这是什么原因?
这里是我的.wsgi文件:
import os
import sys
sys.stdout = sys.stderr
# Add the virtual Python environment site-packages directory to the path
import site
site.addsitedir('/usr/lib/python2.6/dist-packages')
#If your project is not on your PYTHONPATH by default you can add the following
sys.path.append('/Dropbox/project/www/')
sys.path.append('/Dropbox/project/www/project')
# Avoid ``[Errno 13] Permission denied: '/var/www/.python-eggs'`` messages
os.environ['PYTHON_EGG_CACHE'] = '/Dropbox/project/www/mod_wsgi/egg-cache'
os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
你说得对,我没有错过这一行。 thanx一堆! – mgPePe 2011-05-03 21:51:01