如何检查mod_wsgl是否正确安装在apache中

我一直在试图安装mod_wsgl和Django,但我没有成功。

我正在考虑一步一步来。

把django放在一边如何确保我已经正确安装了mod_wsgl,以便我的python脚本可以从网站运行

然后我会考虑Django

我只想在浏览器中使用python显示你好

我在哪里可以放置我的hello.py,我怎么检查,看看是否mod_wsgl insatlled正确

VirtualHostconfiguration:

<Directory /path/to/webroot/> Options +ExecCGI AddHandler wsgi-script .wsgi </Directory> 

test.wsgi

 def application(environ, start_response): start_response('200 OK',[('Content-type','text/html')]) return ['<html><body>Hello World!</body></html>'] 

如果+ ExecCGI没有设置,你会得到:

 Forbidden You don't have permission to access /test.wsgi on this server. 

一旦你得到.wsgiconfiguration和正常工作,你可能会想要使用这个页面上的Django的.wsgi脚本:

http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html

我不知道Django的文档是否根据Graham Dumpleton的工作进行了修改。

http://code.google.com/p/modwsgi/wiki/DebuggingTechniques

 def application(environ, start_response): status = '200 OK' output = 'Hello World!' print >> environ['wsgi.errors'], "application debug #1" response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) print >> environ['wsgi.errors'], "application debug #2" return [output] 

阅读mod_wsgi站点上的mod_wsgi文档:

http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide

另请阅读:

http://code.google.com/p/modwsgi/wiki/WhereToGetHelp

它告诉你哪里更好的地方得到mod_wsgi安装问题的帮助是。

抱歉与Graham Dumpleton相抵触​​,但是,我testing了它,没有+ ExecCGI,我得到了上面精确的错误。 我的解决scheme使用新安装的apache虚拟机进行testing,以确保我发布了一个有效的解决scheme。

我会张贴这个评论,但由于某种原因,我的代表之前被删除。