Changes between Initial Version and Version 1 of TracModPython

Nov 16, 2005, 12:52:28 PM (16 years ago)



  • TracModPython

    v1 v1  
     1= Trac and mod_python =
     3Trac 0.7.1 and later supports [ mod_python], which speeds up Trac's response times considerably and permits use of many Apache features not possible with tracd/mod_proxy.
     5== Simple configuration ==
     7Here's a typical Trac CGI/Apache setup:
     10ScriptAlias /projects/myproject /path/to/python/share/trac/cgi-bin/trac.cgi
     11<Location /projects/myproject>
     12   SetEnv TRAC_ENV /var/trac/myproject
     16The equivalent mod_python setup is:
     19<Location /projects/myproject>
     20   SetHandler mod_python
     21   PythonHandler trac.ModPythonHandler
     22   PythonOption TracUriRoot "/projects/myproject"
     23   PythonOption TracEnv /var/trac/myproject
     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.
     29== Setting up multiple projects ==
     31The Trac mod_python handler handler supports a configuration option similar to Subversion's {{{SvnParentPath}}}, called {{{TracEnvParentDir}}}:
     34<Location /projects>
     35  SetHandler mod_python
     36  PythonHandler trac.ModPythonHandler
     37  PythonOption TracUriRoot /projects
     38  PythonOption TracEnvParentDir "/var/trac"
     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.
     45=== Adding authentication ===
     47Adding authentication is straightforward in both cases. For example:
     50<LocationMatch /projects/[[:alnum:]]+/login>
     51  AuthType Basic
     52  AuthName "Trac"
     53  AuthUserFile /var/www/passwd
     54  Require valid-user
     58=== Win32 Issues ===
     60If you run trac with mod_python on Windows, attachments will not work.
     62There is a (simple) workaround for this which is to apply the patch attached to
     63ticket [ #554].
     67See also TracGuide, TracInstall, TracMultipleProjects