Edgewall Software

Changes between Version 17 and Version 18 of ModPython


Ignore:
Timestamp:
Nov 15, 2004, 2:57:50 AM (19 years ago)
Author:
daniel
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ModPython

    v17 v18  
    1 = Trac and mod_python =
    2 
    3 Trac 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 
    7 Here's a typical Trac CGI/Apache setup:
    8 
    9 {{{
    10 ScriptAlias /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 
    16 The 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 
    27 Note 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 
    31 The Trac mod_python handler handler supports a configuration option similar to Subversion's {{{SvnParentPath}}}, called {{{TracEnvParentDir}}}:
    32 
    33 {{{
    34 <LocationMatch /projects>
    35   SetHandler mod_python
    36   PythonHandler trac.ModPythonHandler
    37   PythonOption TracUriRoot /projects
    38   PythonOption TracEnvParentDir "/var/trac"
    39 </LocationMatch>
    40 }}}
    41 
    42 When 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 
    47 Adding 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 
    60 If you run trac with mod_python on Windows, attachments will not work.
    61 
    62 There is a (simple) workaround for this which is to apply the patch attached to
    63 ticket [http://projects.edgewall.com/trac/ticket/554 #554].
    64 
    65 
    66 ----
    67 See also TracGuide, TracInstall, TracMultipleProjects
     1See TracModPython