Stedy
Stedy

Reputation: 7469

mod_wsgi test wsgi runs fine, application gives HTTP 500

I am trying to get a flask application running on an Apache server (2.2.15) running CentOS 6.3 (SE linux disabled) and am using mod_wsgi (3.3 installed from source) to do so.

I tried the test script here and that returns an HTTP 200 but when I place my application in the same directory and adjust httpd.conf accordingly, I get a HTTP 500.

Here is the relevant part of my /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>

I have a similar application running on a linode server running Debian 6, which worked pretty much right out of the box.

EDIT: Checking the error log shows the script is called:

[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'.

I am not sure what to try next.

Upvotes: 1

Views: 1025

Answers (1)

Stedy
Stedy

Reputation: 7469

Upon further testing, it turns out that the culprit was non-explicit path names for the sqlite database the application was calling. The test on the mod_wsgi debugging page worked fine as did the example from flask.

Upvotes: 1

Related Questions