Ho testato la configurazione su una casella Gentoo locale, ma su Strato-vServer non funziona:
$ apache2 -M|grep wsgi
wsgi_module (shared)
# cat /etc/apache2/sites-enabled/000-default
<VirtualHost *:80>
DocumentRoot /var/www/vhosts/default/
<Directory /var/www/vhosts/default/>
Options Indexes FollowSymLinks MultiViews ExecCGI
AddHandler cgi-script .cgi
AddHandler wsgi-script .wsgi
SetHandler wsgi-script
Options ExecCGI
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ "/var/www/vhosts/default/cgi-bin/"
<Directory "/var/www/vhosts/default/cgi-bin/">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
Lo script wsgi:
root@h1900160:/var/www/vhosts/default/cgi-bin# cat test.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]
Lo script viene visualizzato solo come testo normale. Registro errori dice questo:
[Fri May 13 12:54:02 2011] [info] mod_wsgi (pid=14311): Attach interpreter ''.