Deployment under mod_wsgi

In a mod_wsgi configuration, there will be multiple process which need to use the same ZODB. We can acoomodate this requirement by modifying etc/zope.conf, configuring the Zope instance to use ClientStorage and a ZEO server instead of a FileStorage.

Repoze in Deployment architecture diagram

After such changes, the repoze application environment directory may be deployed to an Apache / mod_wsgi 2.X environment with an Apache configuration like this:

      WSGIPythonHome ${sandbox}
      WSGIDaemonProcess tmp threads=1 processes=4 maximum-requests=10000 python-path=${sandbox}/lib/python2.4/site-packages

      <VirtualHost *:80>
        ServerName my.machine.local
        WSGIScriptAlias /site ${sandbox}/bin/zope2.wsgi
        WSGIProcessGroup tmp
        WSGIPassAuthorization On
        SetEnv HTTP_X_VHM_HOST http://my.machine.local/site
        SetEnv PASTE_CONFIG ${sandbox}/etc/zope2.ini
      </VirtualHost>

The bin/zope2.wsgi file is a generic WSGI application loader which uses Paste to parse the etc/zope2.ini file and configure the application for use under mod_wsgi.