| 8 | {{{ |
| 9 | apt-get install libapache2-mod-wsgi |
| 10 | vim /etc/apache2/sites-available/web2py |
| 11 | }}} |
| 12 | |
| 13 | {{{ |
| 14 | <VirtualHost ip.ip.ip.ip:80> |
| 15 | ServerName demo.sahana3.org |
| 16 | ServerAdmin webmaster@sahana3.org |
| 17 | DocumentRoot /var/www/web2py/applications |
| 18 | |
| 19 | WSGIScriptAlias / /var/www/web2py/wsgihandler.py |
| 20 | WSGIDaemonProcess web2py user=www-data group=www-data home=/var/www/web2py processes=10 maximum-requests=500 |
| 21 | |
| 22 | RewriteEngine On |
| 23 | RewriteRule ^/$ /sahana/ [R] |
| 24 | |
| 25 | ### admin only accessible via SSH Tunnel |
| 26 | <Location "/admin"> |
| 27 | SSLRequireSSL |
| 28 | </Location> |
| 29 | ### appadmin requires SSL |
| 30 | <LocationMatch "^(/[\w_]*/appadmin/.*)"> |
| 31 | SSLRequireSSL |
| 32 | </LocationMatch> |
| 33 | ### static files do not need WSGI |
| 34 | <LocationMatch "^(/[\w_]*/static/.*)"> |
| 35 | Order Allow,Deny |
| 36 | Allow from all |
| 37 | </LocationMatch> |
| 38 | ### everything else goes over WSGI |
| 39 | <Location "/"> |
| 40 | Order deny,allow |
| 41 | Allow from all |
| 42 | WSGIProcessGroup web2py |
| 43 | </Location> |
| 44 | |
| 45 | ErrorLog /var/log/apache2/demo_error.log |
| 46 | LogLevel warn |
| 47 | CustomLog /var/log/apache2/demo_access.log combined |
| 48 | </VirtualHost> |
| 49 | }}} |
| 50 | |
| 51 | {{{ |
| 52 | cd /etc/apache2/sites-available/ |
| 53 | ln -s /etc/apache2/sites-available/web2py |
| 54 | /etc/init.d/apache2 restart |
| 55 | }}} |