wiki:InstallationGuidelinesApacheModWSGI

Version 8 (modified by Fran Boon, 13 years ago) ( diff )

/etc/init.d/apache2 force-reload

Installation on Apache with WSGI

This is what is used to host the Demo site & Trac (sharing just 128Mb RAM!)

Ubuntu

apt-get install libapache2-mod-wsgi
a2enmod rewrite
vim /etc/apache2/sites-available/web2py
<VirtualHost ip.ip.ip.ip:80>
  ServerName demo.sahanapy.org
  ServerAdmin webmaster@sahanapy.org
  DocumentRoot /var/www/web2py/applications 

  WSGIScriptAlias / /var/www/web2py/wsgihandler.py
  WSGIDaemonProcess web2py user=www-data group=www-data home=/var/www/web2py processes=10 maximum-requests=500

  RewriteEngine On
  RewriteRule ^/$ /sahana/ [R]

  ### admin only accessible via SSH Tunnel
  <Location "/admin">
    SSLRequireSSL
  </Location>
  ### appadmin requires SSL
  <LocationMatch "^(/[\w_]*/appadmin/.*)">
    SSLRequireSSL
  </LocationMatch>
  ### static files do not need WSGI
  <LocationMatch "^(/[\w_]*/static/.*)">
    Order Allow,Deny
    Allow from all
  </LocationMatch>
  ### everything else goes over WSGI
  <Location "/">
    Order deny,allow
    Allow from all
    WSGIProcessGroup web2py
  </Location>

  ErrorLog /var/log/apache2/demo_error.log
  LogLevel warn
  CustomLog /var/log/apache2/demo_access.log combined
</VirtualHost>
ln -s /etc/apache2/sites-available/web2py /etc/apache2/sites-enabled/web2py
/etc/init.d/apache2 force-reload

InstallationGuidelines

Note: See TracWiki for help on using the wiki.