您好采用世界mod_wsgi的,内部错误,配置错误 [英] Hello World using mod_wsgi, Internal error, misconfiguration
问题描述
我在Windows中,并正尝试调用Apache服务器上的mod_wsgi。我位于 mod_wsgi.so / usr / lib中/的Apache2 /模块/
和我有一个名为MyApp的目录 - /主页/ danu_bg /的public_html / MyApp的
。
在这个目录中我有 application.wsgi
高清应用(ENVIRON,start_response):
状态=200 OK
输出=世界,你好!
response_headers = [('内容类型,text / plain的),
(内容长度,STR(LEN(输出)))]
start_response(状态,response_headers)
返回[输出]
而的.htaccess
配置文件是
<目录为/ home / danu_bg /的public_html / MyApp的>
WSGIScriptAlias /home/danu_bg/public_html/MyApp/application.wsgi
订购允许,拒绝
所有允许
< /目录>
我不认为我可以访问主配置文件, httpd.config
当我看着 / usr / lib中/的Apache2 /建
我看到 config.nice
却看不到 httpd.config
我的WinSCP连接到服务器,我没有shell访问。 当我去的网址,我得到这个错误
内部服务器错误
服务器遇到一个内部错误或配置错误,无法完成您的请求
当我看网页的 HTTPS://$c$c.google.com/p/modwsgi/wiki/ConfigurationDirectives
我看到了 WSGIScriptAlias
指令语法如下:
WSGIScriptAlias /名称/网络/ WSGI-脚本/名称
所以,该指令有两个参数:URI和WSGI脚本。你的情况可能是这样的:
WSGIScriptAlias /应用/public_html/MyApp/application.wsgi
揭露/应用程序的URL在你的应用程序。
I'm on Windows, and am trying to invoke mod_wsgi on an Apache server. I located mod_wsgi.so in /usr/lib/apache2/modules/
and I have a directory called MyApp - /home/danu_bg/public_html/MyApp
.
Within this directory I have application.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]
And the .htaccess
configuration file is
<Directory /home/danu_bg/public_html/MyApp>
WSGIScriptAlias /home/danu_bg/public_html/MyApp/application.wsgi
Order allow,deny
Allow from all
</Directory>
I don't think I can access the main configuration file, httpd.config
when I look in /usr/lib/apache2/build
I see config.nice
but don't see httpd.config
I'm using WinSCP to connect to the server, I do not have shell access. When I go to the URL, I get this error
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request
When I look at the page https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives
I see the following syntax for the WSGIScriptAlias
directive:
WSGIScriptAlias /name /web/wsgi-scripts/name
So the directive takes two arguments: the URI and the wsgi script. In your case that might be something like:
WSGIScriptAlias /app /public_html/MyApp/application.wsgi
to expose your application under the /app URL.
这篇关于您好采用世界mod_wsgi的,内部错误,配置错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!