Code
<VirtualHost *:80>
<Directory "{$path}/www">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName localhost
ServerAlias localhost *
ScriptAlias /cgi-bin/ "{$path}/www/cgi-bin"
DocumentRoot "{$path}/www"
ErrorLog "{$path}/apache/logs/error.log"
CustomLog "{$path}/apache/logs/access.log" combined
<Directory "{$path}/www/wsgi-scripts">
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias /myapp "{$path}/www/wsgi-scripts/myapp.wsgi"
</VirtualHost>
Code
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]