@@ -317,6 +317,7 @@ There are three web interfaces to choose from:
3173171. `web server cgi-bin`_
3183182. `stand-alone web server`_
3193193. `Zope product - ZRoundup`_
320+ 4. `Apache HTTP Server with mod_python`_
320321
321322You may need to give the web server user permission to access the tracker home
322323- see the `UNIX environment steps`_ for information. You may also need to
@@ -387,6 +388,76 @@ code tree lib/python/Products.
387388When you next (re)start up Zope, you will be able to add a ZRoundup object
388389that interfaces to your new tracker.
389390
391+ Apache HTTP Server with mod_python
392+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
393+
394+ `Mod_python`_ is an `Apache`_ module that embeds the Python interpreter
395+ within the server. Running Roundup this way is much faster than all
396+ above options and, like `web server cgi-bin`_, allows to use HTTPS
397+ protocol. The drawback is that this setup is more complicated.
398+
399+ The following instructions were tested on apache 2.0 with mod_python 3.1.
400+ If you are using older versions, your mileage may vary.
401+
402+ Mod_python uses OS threads. If your apache was built without threads
403+ (quite commonly), you must load the threading library to run mod_python.
404+ This is done by setting ``LD_PRELOAD`` to your threading library path
405+ in apache ``envvars`` file. Example for gentoo linux (``envvars`` file
406+ is located in ``/usr/lib/apache2/build/``)::
407+
408+ LD_PRELOAD=/lib/libpthread.so.0
409+ export LD_PRELOAD
410+
411+ Example for FreeBSD (``envvars`` is in ``/usr/local/sbin/``)::
412+
413+ LD_PRELOAD=/usr/lib/libc_r.so
414+ export LD_PRELOAD
415+
416+ Next, you have to add Roundup trackers configuration to apache config.
417+ In the following example we have two trackers set up in
418+ ``/var/db/roundup/support`` and ``var/db/roundup/devel`` and accessed
419+ as ``https://my.host/roundup/support/`` and ``https://my.host/roundup/devel/``
420+ respectively. Having them share same parent directory allows us to
421+ reduce the number of configuration directives.
422+
423+ Static files from ``html`` directory are served by apache itself - this
424+ is quickier and generally more robust than doing that from python.
425+ Everything else is aliased to dummy (non-existing) ``py`` file,
426+ which is handled by mod_python and our roundup module.
427+
428+ Example mod_python configuration::
429+
430+ #################################################
431+ # Roundup Issue tracker
432+ #################################################
433+ # enable Python optimizations (like 'python -O')
434+ PythonOptimize On
435+ # let apache handle static files from 'html' directories
436+ AliasMatch /roundup/(.+)/@@file/(.*) /var/db/roundup/$1/html/$2
437+ # everything else is handled by roundup web UI
438+ AliasMatch /roundup/([^/]+)/(?!@@file/)(.*) /var/db/roundup/$1/dummy.py/$2
439+ # roundup requires a slash after tracker name - add it if missing
440+ RedirectMatch permanent /roundup/([^/]+)$ /roundup/$1/
441+ # common settings for all roundup trackers
442+ <Directory /var/db/roundup/*>
443+ Order allow,deny
444+ Allow from all
445+ AllowOverride None
446+ Options None
447+ AddHandler python-program .py
448+ PythonHandler roundup.cgi.apache
449+ # uncomment the following line to see tracebacks in the browser
450+ # (note that *some* tracebacks will be displayed anyway)
451+ #PythonDebug On
452+ </Directory>
453+ # roundup tracker homes
454+ <Directory /var/db/roundup/devel>
455+ PythonOption TrackerHome /var/db/roundup/devel
456+ </Directory>
457+ <Directory /var/db/roundup/support>
458+ PythonOption TrackerHome /var/db/roundup/support
459+ </Directory>
460+
390461
391462Configure an Email Interface
392463----------------------------
@@ -650,9 +721,14 @@ Next: `User Guide`_
650721.. _`customising roundup`: customizing.html
651722.. _`upgrading document`: upgrading.html
652723.. _`administration guide`: admin_guide.html
653- .. _pybsddb: http://pybsddb.sourceforge.net/
654- .. _pysqlite: http://pysqlite.sourceforge.net/
724+
725+
726+ .. _External hyperlink targets:
727+
728+ .. _apache: http://httpd.apache.org/
655729.. _metakit: http://www.equi4.com/metakit/
656- .. _Psycopg : http://initd. org/software/initd/psycopg
730+ .. _mod_python : http://www.modpython. org/
657731.. _MySQLdb: http://sourceforge.net/projects/mysql-python
658-
732+ .. _Psycopg: http://initd.org/software/initd/psycopg
733+ .. _pybsddb: http://pybsddb.sourceforge.net/
734+ .. _pysqlite: http://pysqlite.sourceforge.net/
0 commit comments