I was arch testing mod_wsgi for x86 stabilization and needed to test it so here is what I did.
First you will need to have apache working fine I have;
www-servers/apache-2.2.16Then I installed ~x86 version of mod_wsgi;
emerge -av www-apache/mod_wsgi [ebuild R ] www-apache/mod_wsgi-3.3
Next I created a little test;
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]
Saved it as /var/www/localhost/htdocs/hello.py
Next I edited vim /etc/apache2/vhosts.d/default_vhost.include
and added;
WSGIScriptAlias / /var/www/localhost/htdocs/hello.py
Next To enable mod_wsgi, you need to edit your /etc/conf.d/apache2 file and add '-D WSGI' to APACHE2_OPTS.
Here is my line;
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D MANUAL -D SSL -D \ SSL_DEFAULT_VHOST -D LANGUAGE -D PHP5 -D WSGI"
Now when you restart the server you should see on http://localhost/ the "Hello World!" message.
Thats it!
Powered by Drupal and Drupal Theme created by vigilianty.