使用Apache 2.2 / Win7
在httpd.conf中:
LoadModule wsgi_module modules/mod_wsgi.so
....
WSGIScriptAlias /wsgi/ "J:/py.cherrypy/"
<Directory "J:/py.cherrypy">
Order allow,deny
Allow from all
<Files "*.*">
</Files>
</Directory>
在J:/py.cherrypy/test.wsgi:
def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
指向
http://localhost:8080/wsgi/test.wsgi
返回在此服务器上找不到请求的URL /wsgi/test.wsgi。
localhost:8080很好
答案 0 :(得分:0)
使用
WSGIScriptAlias /myapp j:/py.cherrypy/test.wsgi
<Directory j:/py.cherrypy>
Order allow,deny
Allow from all
</Directory>
wget 127.0.0.1:8080/myapp工作正常