403 Forbidden错误使用Django和mod_wsgi的 [英] 403 Forbidden error with Django and mod_wsgi
问题描述
我创建Django项目的主目录,以便它在主目录。
I created Django project in home directory so it is in home directory.
设置
Django Verison : 1.5.1
Python Version : 2.7.5
mod_wsgi Version: 3.4
Home Directory : /home/aettool
目录 /home/aettool/aet/apache/django.wsgi
Contents of /home/aettool/aet/apache/django.wsgi
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'aet.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
的httpd.conf
的客户服务联系
Contect of httpd.conf
WSGIScriptAlias / /home/aettool/aet/apache/django.wsgi
<Directory /home/aettool/aet/apache>
Order deny,allow
Allow from all
</Directory>
错误 error_log中
Error in error_log
[Sun Jul 21 02:01:30.923364 2013] [authz_core:error] [pid 21540:tid 1193011520] [client 10.20.17.184:51340] AH01630: client denied by server configuration: /home/aettool/aet/apache/django.wsgi
目录 urls.py
Contents of urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
)
775
Permissions of /home/aettool/aet : 775
我收到浏览器的误差 I am getting error on browser 请帮我出的配置。 修改 有关现在我改变前进 到 所以,这无疑是与 So,this has definitely something to do with 显然,这是关系到Apache的2.4和旧版本的问题。 Apparently this is an issue that is related to Apache 2.4 and older versions.
You need to replace in your apache configuration: 与 在 这篇关于403 Forbidden错误使用Django和mod_wsgi的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! /家庭/ aettool / AET的权限
的权限的/ home / aettool / AET /阿帕奇:755
django.wsgi文件的权限:664
403禁止
您没有权限访问/在此服务器上。
403 Forbidden
You don't have permission to access / on this server.
<Directory />
AllowOverride none
Require all denied
</Directory>
<Directory />
Order deny,allow
Allow from all
</Directory>
的httpd.conf
文件的配置,但我担心的是我只加了5条线在该文件中,并不能弄清楚什么是错的。httpd.conf
file configuration,but my worry is that I only added 5 lines in that file and not able to figure out what's wrong .推荐答案
你需要在你的Apache配置来替换:Allow from all
Require all granted
&LT;文件wsgi.py&GT;
部分