Changes between Initial Version and Version 1 of TracModPython


Ignore:
Timestamp:
Sep 2, 2005, 8:24:46 AM (19 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracModPython

    v1 v1  
     1= Trac and mod_python =
     2
     3Trac 0.7.1 and later supports [http://www.modpython.org/ mod_python], which speeds up Trac's response times considerably and permits use of many Apache features not possible with tracd/mod_proxy.
     4
     5== Simple configuration ==
     6
     7Here's a typical Trac CGI/Apache setup:
     8
     9{{{
     10ScriptAlias /projects/myproject /path/to/python/share/trac/cgi-bin/trac.cgi
     11<Location /projects/myproject>
     12   SetEnv TRAC_ENV /var/trac/myproject
     13</Location>
     14}}}
     15
     16The equivalent mod_python setup is:
     17
     18{{{
     19<Location /projects/myproject>
     20   SetHandler mod_python
     21   PythonHandler trac.ModPythonHandler
     22   PythonOption TracUriRoot "/projects/myproject"
     23   PythonOption TracEnv /var/trac/myproject
     24</Location>
     25}}}
     26
     27Note that the option ''TracUriRoot'' may or may not be necessary in your setup. Try without first, and if the URLs produced by Trac look wrong, add the ''TracUriRoot'' option.
     28
     29== Setting up multiple projects ==
     30
     31The Trac mod_python handler handler supports a configuration option similar to Subversion's {{{SvnParentPath}}}, called {{{TracEnvParentDir}}}:
     32
     33{{{
     34<Location /projects>
     35  SetHandler mod_python
     36  PythonHandler trac.ModPythonHandler
     37  PythonOption TracUriRoot /projects
     38  PythonOption TracEnvParentDir "/var/trac"
     39</LocationMatch>
     40}}}
     41
     42When you request the {{{/projects}}} URL, you will get a (currently very simple) listing of all subdirectories of the directory you set as {{{TracEnvParentDir}}}. Selecting any project in the list will bring you to the corresponding Trac instance. You should make sure that the configured directory only contains Trac environment directories that match the currently installed Trac version, because that is not checked prior the the generation of the project list.
     43
     44
     45=== Adding authentication ===
     46
     47Adding authentication is straightforward in both cases. For example:
     48
     49{{{
     50<LocationMatch /projects/[[:alnum:]]+/login>
     51  AuthType Basic
     52  AuthName "Trac"
     53  AuthUserFile /var/www/passwd
     54  Require valid-user
     55</LocationMatch>
     56}}}
     57
     58=== Win32 Issues ===
     59
     60If you run trac with mod_python on Windows, attachments will not work.
     61
     62There is a (simple) workaround for this which is to apply the patch attached to
     63ticket [http://projects.edgewall.com/trac/ticket/554 #554].
     64
     65
     66----
     67See also TracGuide, TracInstall, TracMultipleProjects