【问题标题】:mod_wsgi test wsgi runs fine, application gives HTTP 500mod_wsgi 测试 wsgi 运行良好,应用程序给出 HTTP 500
【发布时间】:2012-09-07 03:32:01
【问题描述】:

我正在尝试在运行 CentOS 6.3(SE linux 已禁用)的 Apache 服务器(2.2.15)上运行烧瓶应用程序,并且正在使用 mod_wsgi(从源代码安装 3.3)来执行此操作。

我尝试了测试脚本 here 并返回 HTTP 200,但是当我将应用程序放在同一目录中并相应地调整 httpd.conf 时,我得到了 HTTP 500。

这是我/etc/httpd/conf/httpd.conf的相关部分:

LoadModule wsgi_module modules/mod_wsgi.so
WSGISocketPrefix /tmp/wsgi
<VirtualHost *:80>
#    ServerAdmin root@localhost
    DocumentRoot /var/www/html/
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
     ServerName XXXX.YYYYY.org
     WSGIDaemonProcess irbsite user=apache group=apache threads=5
     WSGIScriptAlias / /var/www/html/irbsite.wsgi

     <Directory />
    WSGIProcessGroup irbsite
    WSGIApplicationGroup %{GLOBAL}
    Order deny,allow
    Allow from all
    </Directory>

我在运行 Debian 6 的 linode 服务器上运行了一个类似的应用程序,它开箱即用。

编辑:检查错误日志显示脚本被调用:

[Thu Sep 13 17:24:45 2012] [info] mod_wsgi (pid=6223): Attach interpreter ''.
[Thu Sep 13 17:24:45 2012] [info] mod_wsgi (pid=6228): Attach interpreter ''.
[Thu Sep 13 17:24:45 2012] [info] mod_wsgi (pid=6229): Attach interpreter ''.
[Thu Sep 13 17:24:45 2012] [info] mod_wsgi (pid=6230): Attach interpreter ''.
[Thu Sep 13 17:24:45 2012] [info] mod_wsgi (pid=6231): Attach interpreter ''.
[Thu Sep 13 17:24:47 2012] [info] [client 140.107.134.36] mod_wsgi (pid=6223, process='irbsite', application=''): Loading WSGI script '/var/www/html/irbsite.wsgi'.

我不确定下一步该尝试什么。

【问题讨论】:

  • 接下来我会尝试什么:检查 apache 的 error_log。

标签: python apache centos mod-wsgi flask


【解决方案1】:

经过进一步测试,结果发现罪魁祸首是应用程序正在调用的 sqlite 数据库的非显式路径名。 mod_wsgi 调试页面上的测试工作正常,flask 中的example 也是如此。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-11-15
    • 2017-06-07
    • 1970-01-01
    • 2011-02-07
    • 2016-01-02
    • 2017-11-16
    • 2021-07-20
    相关资源
    最近更新 更多