web2py and Apache mod_proxy and mod_wsgi

[edit]

In a production environment you should use web2py with Apache or lighttpd. With Apache there are two ways.

The easy way

install mod_proxy and send all your requests to the web2py web server. You would put something like this in your /etc/apache2/sites-available/default

NameVirtualHost *:80
<VirtualHost *:80>
   <Location "/">
     Order deny,allow
     Allow from all
     ProxyPass http://127.0.0.1:8000/
     ProxyPassReverse http://127.0.0.1:8000/
   </Location>
   LogFormat "%h %l %u %t "%r" %>s %b" common
   CustomLog /var/log/apache2/access.log common
</VirtualHost>

or you can use modwsgi. web2py is wsgi compliant. This requires that you use the source version of web2py and you read the modwsgi documentation.



Comments


Tito on 2008-06-27 23:00:24 says
Please remeber to enable the module proxy_http [inappropriate?]