== Installation on Apache with WSGI == This is what is used to host the Demo site & Trac (sharing just 128Mb RAM!) * mod_rewrite: http://web2py.com/AlterEgo/default/show/144 If running on a UNIX variant (as would be recommended) then suggest using the [http://www.web2py.com/examples/default/cron#external Native Cron] {{{ vim /etc/crontab 0-59/1 * * * * www-data cd /var/www/web2py/ && python web2py.py -C -D 1 >> /tmp/cron.output 2>&1 cp /var/www/web2py/options_std.py /var/www/web2py/options.py vim /var/www/web2py/options.py extcron = True }}} === Ubuntu === {{{ apt-get install libapache2-mod-wsgi a2enmod rewrite a2enmod deflate a2enmod headers a2enmod expires vim /etc/apache2/sites-available/eden }}} Refer to the following URLs for WSGI configuration tuning: * http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess * http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Memory_Constrained_VPS_Systems {{{ ServerName demo.eden.sahanafoundation.org ServerAdmin webmaster@eden.sahanafoundation.org DocumentRoot /var/www/web2py/applications WSGIScriptAlias / /var/www/web2py/wsgihandler.py ## Edit the process and the maximum-requests to reflect your RAM WSGIDaemonProcess web2py user=www-data group=www-data home=/var/www/web2py processes=5 maximum-requests=50 RewriteEngine On RewriteCond %{REQUEST_URI} !/eden/(.*) RewriteRule /(.*) /eden/$1 [R] ### admin only accessible via SSH Tunnel SSLRequireSSL ### appadmin requires SSL SSLRequireSSL ### static files do not need WSGI Order Allow,Deny Allow from all ### everything else goes over WSGI Order deny,allow Allow from all WSGIProcessGroup web2py ErrorLog /var/log/apache2/demo_error.log LogLevel warn CustomLog /var/log/apache2/demo_access.log combined }}} {{{ ln -s /etc/apache2/sites-available/eden /etc/apache2/sites-enabled/eden /etc/init.d/apache2 force-reload }}} WSGI Installation comments: http://blog.dscpl.com.au/2009/08/problems-with-example-web2py.html Another set of Ubuntu docs: http://www.web2pyslices.com/main/slices/take_slice/14 ==== Apache mod_deflate & mod_expires ==== Optimise by using [http://httpd.apache.org/docs/2.2/mod/mod_deflate.html GZip] & [http://httpd.apache.org/docs/2.2/mod/mod_expires.html Expires]: {{{ ### static files do not need WSGI Order Allow,Deny Allow from all SetOutputFilter DEFLATE BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary Header append Vary User-Agent env=!dont-vary ExpiresActive On ExpiresByType text/html "access plus 1 day" ExpiresByType text/javascript "access plus 1 week" ExpiresByType text/css "access plus 2 weeks" ExpiresByType image/ico "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType application/x-shockwave-flash "access plus 1 month" }}} ---- InstallationGuidelines