与mod_wsgi的Django的安装 [英] Installing Django with mod_wsgi

查看:116
本文介绍了与mod_wsgi的Django的安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了使用Django 1.0的应用程序。它正常工作与Django的测试服务器。但是,当我试图把它变成一个更有可能的生产环境Apache服务器无法运行应用程序。
我使用的服务器是 WAMP2.0 。我是一个PHP程序员多年了,我一直在使用WAMPServer长期以来。
我安装了mod_wsgi.so,似乎只是正常工作(无服务的错误),但我不能配置httpd.conf来看看位于服务器根目录之外的我的Python脚本。

I wrote an application using Django 1.0. It works fine with the django test server. But when I tried to get it into a more likely production enviroment the Apache server fails to run the app. The server I use is WAMP2.0. I've been a PHP programmer for years now and I've been using WAMPServer since long ago. I installed the mod_wsgi.so and seems to work just fine (no services error) but I can't configure the httpd.conf to look at my python scripts located outside the server root.

现在,我冷静了重写文档根,服务从文档根Django应用程序代替人工在httpd.conf行应该是这样的:

For now, I'm cool with overriding the document root and serve the django app from the document root instead so the httpd.conf line should look like this:


    WSGIScriptAlias / C:/Users/Marcos/Documents/mysite/apache/django.wsgi

但服务器的响应是不允许的403

but the server's response is a 403 Forbidden

推荐答案

您有:

WSGIScriptAlias / /C:/Users/Marcos/Documents/mysite/apache/django.wsgi

这是错误的,因为RHS是不是有效的Windows路径名。用途:

That is wrong as RHS is not a valid Windows pathname. Use:

WSGIScriptAlias / C:/Users/Marcos/Documents/mysite/apache/django.wsgi

也就是说,Windows驱动器说明符之前没有前导斜杠。

That is, no leading slash before the Windows drive specifier.

除此之外,按照文件的mod_wsgi其他人指出。

Other than that, follow the mod_wsgi documentation others have pointed out.


海报编问题改变什么,现在似乎是在后一个错字,而不是一个问题,他的配置。

Poster edited question to change what now would appear to be a typo in the post and not a problem with his configuration.

如果是这样的话,是一个403下的原因如下:

If that is the case, next causes for a 403 are as follows.

首先,你必须也有:

<Directory C:/Users/Marcos/Documents/mysite/apache>
Order deny,allow
Allow from all
</Directory>

如果您不具有那么Apache不被授予的权限从该目录服务的脚本,因此将返回FORBIDDEN(403)。

If you don't have that then Apache isn't being granted rights to serve a script from that directory and so will return FORBIDDEN (403).

二是,你有,但不承认你做什么,而该目录或WSGI脚本文件是不是由Apache服务的Windows下运行的用户读取。

Second is that you do have that, but don't acknowledge that you do, and that that directory or the WSGI script file is not readable by the user that the Apache service runs as under Windows.

这篇关于与mod_wsgi的Django的安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆