ANSWER:
The WSGI application contained within the code file should be called
"application". Mine was called "simple_app" to start. (It's in the
readme file)
QUESTION:
I'm trying to set up mod_wsgi with a test application but I'm getting
a 404 not found error: "The requested URL / was not found on this
server.", and the log file says:
[Fri Oct 12 23:48:55 2007] [error] [client 69.255.191.154] mod_wsgi
(pid=15437): Target WSGI script '/var/www/mod_wsgi_test.py' does not
contain WSGI application '/var/www/mod_wsgi_test.py::application'.
I'm on Ubuntu 7.04 with Apache/2.2.3, mod_wsgi/1.1, and Python/
2.5.1c1
Thanks,
-Greg
Here's how I set things up:
/etc/apache2/httpd.conf
------------------------------------
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
/etc/apache2/sites-available/default
------------------------------------
NameVirtualHost *
<VirtualHost *>
ServerAdmin xxx...@gmail.com
DocumentRoot /var/www/
WSGIScriptAlias / /var/www/mod_wsgi_test.py
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
AllowOverride None
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
ServerSignature On
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>
/var/www/mod_wsgi_test.py
---------------------------------------
#! /usr/bin/env python2.5
def simple_app(environ, start_response):
"""Simplest possible application object"""
status = '200 OK'
response_headers = [('Content-type','text/plain')]
start_response(status, response_headers)
return ['Hello world!\n']
I was about to send the message below and then I figured out the
answer. I figured I'll still send it though so the answer is
documented for people like me who search before reading
documentation :-(
ANSWER:
The WSGI application contained within the code file should be called
"application". Mine was called "simple_app" to start. (It's in the
readme file)
Not at present
It is down for being implemented in 2007 though.
http://code.google.com/p/support/issues/detail?id=376
Graham