Apache mod_wsgi Django 设置 - 禁止 您无权访问此服务器上的 /mysite
我已经在 Windows XP 上安装了 python 26、Apache 2.2、modwsgi ap2.2 py26。 apache 加载 modwsgi 很好。 当我检查本地主机时:apache 说 - 它有效! 但是当我尝试打开 Django 目录 mysite: localhost/mysite 我 得到 : 禁止 您无权访问此服务器上的 /mysite。 我已经重新安装并安装了很多次但仍然如此 事物。教程说应该得到:它有效 httpd.conf LoadModule wsgi_module 模块/mod_wsgi.so WSGIScriptAlias / /mysite/apache/mysite.wsgi 运行良好,如: http://docs.djangoproject.com/en /dev/howto/部署/modwsgi/ 我的项目路径是C:\mysite 并根据“http://docs.djangoproject.com/en/dev /howto/部署/modwsgi/" mysite.wsgi 路径为 C:\mysite\apache\mysite.wsgi 我已经搜索了这个问题,但是 Linux 上的解决方案请任何人给我 Windows 上的答案。
错误日志是:- [错误] [客户端 127.0.0.1] 客户端被服务器配置拒绝:C:/mysite/apache/mysite.wsgi 有人可以帮忙解决这个问题吗... 谢谢
I have install python 26, Apache 2.2, modwsgi ap2.2 py26 On windows XP.
and apache loads modwsgi fine.
when I check localhost: apache says - It works!
but when i try to open the Django directory mysite: localhost/mysite i
get :
Forbidden
You don't have permission to access /mysite on this server.
I have re-installed and installed this many times but still the same
thing. The tutorial says should get: It worked
httpd.conf
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /mysite/apache/mysite.wsgi
runs fine, as in: http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/
My project path is C:\mysite
and according to "http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/"
mysite.wsgi path is C:\mysite\apache\mysite.wsgi
I have search the for this problem but solution on the Linux please any one give me the answer for windows.
and error log is:-
[error] [client 127.0.0.1] client denied by server configuration: C:/mysite/apache/mysite.wsgi
could someone please help with this...
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此配置片段来自 Linux,而不是 Windows,但是(除了路径名差异)应该非常代表良好的 mod_wsgi 配置。鉴于您所描述的症状,听起来您没有正确获得
mysite.wsgi
的目录权限块。简而言之,任何想要查看站点任何部分的人都必须能够“访问”包含该文件的目录。This configuration snippet is from Linux, not Windows, but (pathname differences aside) should be pretty representative of a good mod_wsgi configuration. Given the symptoms you've described, it sounds like you didn't get the directory permissions block for
mysite.wsgi
correct. In short, anyone you want to view any part of your site must have 'access' to the directory that contains that file.在httpd.conf中添加以下代码:
add following code in httpd.conf: