.htaccess Hello World使用mod_wsgi,内部错误,配置错误

vptzau2j  于 2023-01-26  发布在  其他
关注(0)|答案(2)|浏览(94)

我在Windows上,并试图调用Apache服务器上的mod_wsgi。我在/usr/lib/apache2/modules/中找到了mod_wsgi. so,并有一个名为MyApp -/home/danu_bg/public_html/MyApp的目录。
在此目录中,我有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]

.htaccess配置文件为

<Directory /home/danu_bg/public_html/MyApp>
WSGIScriptAlias /home/danu_bg/public_html/MyApp/application.wsgi
Order allow,deny
Allow from all
</Directory>

我想我无法访问主配置文件httpd.config当我查看/usr/lib/apache2/build时,我看到config.nice,但看不到httpd.config
我正在使用WinSCP连接到服务器,我没有shell访问权限。当我转到URL时,收到此错误

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request
az31mfrm

az31mfrm1#

当我看到https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives页面时
我看到WSGIScriptAlias指令的语法如下:

WSGIScriptAlias /name /web/wsgi-scripts/name

因此,该指令有两个参数:URI和wsgi脚本。在您的情况下,可能类似于:
WSGIS脚本别名/应用程序/公共_html/我的应用程序/应用程序.wsgi
以在/app URL下公开您的应用程序。

ui7jx7zq

ui7jx7zq2#

也许这是一种形式的缩进错误出现时,一个newtyper试图键入的东西:
404错误提示https://pastebin.com/LgvyNWVX修复了虚拟主机文件default_vhost_wsgi

  • -归零:好的,对的,对的,你不会发现他们就像是一个十字路口-便利店让它jcpennies好的,对的,对的:以及他们如何使用相同的东西来区分,例如在此选项卡上发送的数据接收:〈-学校与:找到目标co的根哦,但我只是学习:将弹出-打开此阵列软件按钮阵列;意思是他们都喜欢,但我做:
  • 然后保存为文件来自MASM/NASA:[p [[pedp [终端glypbutton

1.:在端口8080上设置虚拟主机:必须在URL中指定此内容:作为单独的vhost文件,如00_default_vhost_wsgi:https://pastebin.com/CMdgj4Ne:及其***工作:
...如果您想修复它:https://pastebin.com/HEyscL7T WSGIS脚本别名/python_helloworld_wsgi "/var/www/本地主机/wsgi脚本/python_helloworld. wsgi "
〈目录"/var/www/localhost/wsgi-scripts "〉选项执行CGI添加处理程序cgi-script. cgi添加处理程序wsgi-script. wsgi要求所有已授予的
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
https://pastebin.com/exSCDPY7
'def应用程序(环境,启动响应):status ='200 OK'输出= b '您好,世界!'

response_headers = [('Content-type', 'text/plain'),
                    ('Content-Length', str(len(output)))]
start_response(status, response_headers)

return [output]'

相关问题