I'm new to mod_wsgi, but not to web applications or web servers. I've
followed the installations instructions, then created the simple app
described in the quick configuration guide. When I request
http://my.server.com/myapp
the request is not handled by mod_wsgi.
The one complexity is that I also have mod_jk installed, and the last
worker directive handles /*, while the wsgi directive is maps the URI /
testapp . Could this be the problem?
This feels like I'm doing something very basic wrong, but I've been
over the install and config guides several times. Any help would be
appreciated. Thanks in advance.
-Rich
Ubuntu 8.04 LTS on a 64 bit intel
apache and mod-wsgi were installed from Ubuntu packages. Apache is
prefork and I've installed the apache dev package:
% dpkg -l | grep apache
ii apache2 2.2.8-1ubuntu0.11
ii apache2-mpm-prefork 2.2.8-1ubuntu0.11
ii apache2-prefork-dev 2.2.8-1ubuntu0.11
ii apache2-utils 2.2.8-1ubuntu0.11
ii apache2.2-common 2.2.8-1ubuntu0.11
ii libapache2-mod-auth-mysql 4.3.9-4
ii libapache2-mod-jk 1:1.2.25-2
ii libapache2-mod-php5 5.2.4-2ubuntu5.7
ii libapache2-mod-wsgi 1.3-1
Apache start up recognizes wsgi:
[Wed Nov 04 11:36:20 2009] [warn] mod_wsgi: Compiled for Python/
2.5.1.
[Wed Nov 04 11:36:20 2009] [warn] mod_wsgi: Runtime using Python/
2.5.2.
[Wed Nov 04 11:36:20 2009] [warn] mod_wsgi: Python module path '/usr/
lib/python25.zip:/usr/lib/python2.5/:/usr/lib/python2.5/plat-linux2:/
usr/lib/python2.5/lib-tk:/usr/lib/python2.5/lib-dynload'.
[Wed Nov 04 11:36:20 2009] [notice] Apache/2.2.8 (Ubuntu) mod_jk/
1.2.25 PHP/5.2.4-2ubuntu5.7 with Suhosin-Patch mod_wsgi/1.3 Python/
2.5.2 configured -- resuming normal operations
Apache config:
NameVirtualHost *
<VirtualHost *>
ServerName
my.server.com
ServerAlias
my.server.com
WSGIScriptAlias /testapp /usr/local/www/wsgi-scripts/testapp.wsgi
<Directory /usr/local/www/wsgi-scripts>
Order allow,deny
Allow from all
</Directory>
JkMount /japp1/* japp1worker
JkMount /* jrootworker
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
#CustomLog "|/usr/local/bin/
parselog.pl" "[ %v %{%Y %m %d}t ] %h
%l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\""
ServerSignature On
Alias /doc/ "/usr/share/doc/"
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from
127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
Access log:
128.101.35.46 - - [04/Nov/2009:11:36:44 -0600] "GET /testapp HTTP/1.1"
302 - "-" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.15)
Gecko/2009102814 Ubuntu/8.04 (hardy) Firefox/3.0.15"
The 302, I presume, is coming from the "jrootworker" b/c it redirects
me to the login page for that app.