Differences

This shows you the differences between two versions of the page.


apache_mod_wsgi [2017/06/28 16:19] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Apache mod_wsgi ======
  
 +  * [[Apache]]
 +  * [[django]]
 +
 +  * [[http://modwsgi.readthedocs.io/en/develop/|mod_wsgi homepage]]
 +  * [[http://modwsgi.readthedocs.io/en/develop/configuration.html|mod_wsgi Apache Directives]]
 +
 +==== Ubuntu ====
 +
 +In Ubuntu, install the module:
 +
 +<code>
 +aptitude -y install libapache2-mod-wsgi
 +</code>
 +
 +==== Apache 2.4 ====
 +
 +Add an alias for the Python interpreter and set permissions:
 +
 +<code>
 +WSGIScriptAlias /python /usr/local/www/wsgi-scripts/python.wsgi
 +</code>
 +
 +<code>
 +<Directory "/usr/local/www/wsgi-scripts">
 +    Require all granted
 +</Directory>
 +</code>
 +
 +Hello world script for ''python.wsgi'':
 +
 +<code>
 +def application(environ, start_response):
 + status = '200 OK'
 + output = b'Hello, world!'
 + response_headers = [('Content-type', 'text-plain'), ('Content-Length', str(len(output)))]
 + start_response(status, response_headers)
 +
 + return [output]
 +</code>

Navigation
QR Code
QR Code apache_mod_wsgi (generated for current page)