我在這裏發現了一個類似的問題,但沒有幫助我。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