[Repoze-checkins] r625 - in repoze.zope2/trunk: . repoze/zope2 repoze/zope2/etc

Carlos de la Guardia cguardia at yahoo.com
Thu Jan 3 06:33:58 UTC 2008


Author: Carlos de la Guardia <cguardia at yahoo.com>
Date: Thu Jan  3 01:33:57 2008
New Revision: 625

Log:
Fixes for mod_wsgi deployment:
- Added a working sample zope2.wsgi script and modified mkinstance to copy it to the sandbox bin directory on install.
- Removed zope2.wsgi from the list of console-scripts on setup.
- Modified sample apache2.conf to use the new mod_wsgi 2.0 directives and be identical to the example on the web site.


Added:
   repoze.zope2/trunk/repoze/zope2/etc/sample-zope2.wsgi
Modified:
   repoze.zope2/trunk/repoze/zope2/etc/sample-apache2.conf
   repoze.zope2/trunk/repoze/zope2/instance.py
   repoze.zope2/trunk/setup.py

Modified: repoze.zope2/trunk/repoze/zope2/etc/sample-apache2.conf
==============================================================================
--- repoze.zope2/trunk/repoze/zope2/etc/sample-apache2.conf	(original)
+++ repoze.zope2/trunk/repoze/zope2/etc/sample-apache2.conf	Thu Jan  3 01:33:57 2008
@@ -1,17 +1,11 @@
-WSGIPythonExecutable ${sandbox}/bin/python
-WSGIDaemonProcess thegroup threads=1 processes=4 maximum-requests=10000
-
-<Directory ${sandbox}/bin>
-  Order deny,allow
-  Allow from all
-</Directory>
+WSGIPythonHome ${sandbox}
+WSGIDaemonProcess tmp threads=1 processes=4 maximum-requests=10000 python-path=${sandbox}/lib/python2.4/site-packages
 
 <VirtualHost *:80>
-  ServerName www.repoze.org
-  ServerAdmin repoze-dev at repoze.org
-  DocumentRoot ${sandbox}/static
+  ServerName my.machine.local
   WSGIScriptAlias /site ${sandbox}/bin/zope2.wsgi
-  WSGIProcessGroup thegroup
+  WSGIProcessGroup tmp
   WSGIPassAuthorization On
-  SetEnv HTTP_X_VHM_HOST http://www.repoze.org/site
+  SetEnv HTTP_X_VHM_HOST http://my.machine.local/site
+  SetEnv PASTE_CONFIG ${sandbox}/etc/zope2.ini
 </VirtualHost>

Added: repoze.zope2/trunk/repoze/zope2/etc/sample-zope2.wsgi
==============================================================================
--- (empty file)
+++ repoze.zope2/trunk/repoze/zope2/etc/sample-zope2.wsgi	Thu Jan  3 01:33:57 2008
@@ -0,0 +1,13 @@
+"""
+
+Stub for running under mod_wsgi.  Intended to be used as a
+'WSGIScriptAlias' within the Apache configuration, e.g.::
+
+WSGIScriptAlias /site /path/to/sandbox/etc/zope2.wsgi
+
+""" 
+import os
+from paste.deploy import loadapp
+
+ini = '${sandbox}/etc/zope2.ini'
+application = loadapp('config:%s' % ini)

Modified: repoze.zope2/trunk/repoze/zope2/instance.py
==============================================================================
--- repoze.zope2/trunk/repoze/zope2/instance.py	(original)
+++ repoze.zope2/trunk/repoze/zope2/instance.py	Thu Jan  3 01:33:57 2008
@@ -33,3 +33,9 @@
         if not os.path.exists(targetfile):
             open(targetfile, 'w').write(result)
 
+    template = open(os.path.join(here, 'etc', 'sample-zope2.wsgi'), 'r').read()
+    result = rewrite(template, sandbox=sandbox)
+    targetfile = os.path.join(sandbox, 'bin', 'zope2.wsgi')
+    if not os.path.exists(targetfile):
+        open(targetfile, 'w').write(result)
+

Modified: repoze.zope2/trunk/setup.py
==============================================================================
--- repoze.zope2/trunk/setup.py	(original)
+++ repoze.zope2/trunk/setup.py	Thu Jan  3 01:33:57 2008
@@ -70,7 +70,6 @@
         runzope2script = repoze.zope2.scripts.runscript:main
         debugzope2 = repoze.zope2.scripts.debug:main
         installproduct = repoze.zope2.scripts.installproduct:main
-        zope2.wsgi = repoze.zope2.scripts.wsgiloader:main
 
         [paste.server_runner]
         zserver = repoze.zope2.server:run_zserver


More information about the Repoze-checkins mailing list