J'ai testé la configuration sur une boîte Gentoo locale, mais cela ne fonctionne pas sur mon Strato-vServer:
$ 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>
Le 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]
Le script est uniquement affiché en texte brut. Le journal des erreurs dit ceci:
[Fri May 13 12:54:02 2011] [info] mod_wsgi (pid=14311): Attach interpreter ''.
ubuntu
apache-http-server
Tobias Kaminsky
la source
la source