Changes between Version 16 and Version 17 of ModPython
- Timestamp:
- Nov 12, 2004, 8:20:47 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ModPython
v16 v17 2 2 3 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 '''Note''': The mod_python support in 0.7.1 has a couple of bugs that have since been fixed in both the [http://projects.edgewall.com/trac/browser/branches/0.7-stable 0.7 branch] and [http://projects.edgewall.com/trac/browser/trunk trunk], and will be released with [http://projects.edgewall.com/trac/milestone/0.8 0.8].6 4 7 5 == Simple configuration == … … 10 8 11 9 {{{ 12 ScriptAlias / trac/myproject /path/to/python/share/trac/cgi-bin/trac.cgi13 <Location / trac/myproject>14 SetEnv TRAC_ENV /var/ svn/trac/myproject10 ScriptAlias /projects/myproject /path/to/python/share/trac/cgi-bin/trac.cgi 11 <Location /projects/myproject> 12 SetEnv TRAC_ENV /var/trac/myproject 15 13 </Location> 16 14 }}} … … 19 17 20 18 {{{ 21 <Location / trac/myproject>19 <Location /projects/myproject> 22 20 SetHandler mod_python 23 21 PythonHandler trac.ModPythonHandler 24 PythonOption TracUriRoot "/ trac/myproject"25 PythonOption TracEnv /var/ svn/trac/myproject22 PythonOption TracUriRoot "/projects/myproject" 23 PythonOption TracEnv /var/trac/myproject 26 24 </Location> 27 25 }}} … … 31 29 == Setting up multiple projects == 32 30 33 === The easy way ===34 35 31 The Trac mod_python handler handler supports a configuration option similar to Subversion's {{{SvnParentPath}}}, called {{{TracEnvParentDir}}}: 36 32 37 33 {{{ 38 <LocationMatch / trac>34 <LocationMatch /projects> 39 35 SetHandler mod_python 40 36 PythonHandler trac.ModPythonHandler 41 PythonOption TracUriRoot / trac42 PythonOption TracEnvParentDir "/var/ www/projects"37 PythonOption TracUriRoot /projects 38 PythonOption TracEnvParentDir "/var/trac" 43 39 </LocationMatch> 44 40 }}} 45 41 46 When you request the {{{/ trac}}} 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.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. 47 43 48 === Or the hard way ===49 50 The Trac mod_python handler can be configured to serve multiple projects, as can be seen in the following simple example:51 52 {{{53 <LocationMatch /trac/[[:alnum:]]+>54 SetHandler mod_python55 PythonHandler trac.ModPythonHandler56 </LocationMatch>57 <Location /trac/exampleone>58 PythonOption TracUriRoot "/trac/exampleone"59 PythonOption TracEnv "/var/www/projects/exampleone"60 </Location>61 <Location /trac/exampletwo>62 PythonOption TracUriRoot "/trac/exampletwo"63 PythonOption TracEnv "/var/www/projects/exampletwo"64 </Location>65 }}}66 67 This sets up two projects. The disadvantage of the approach used here is that you need one additional {{{<Location>}}} directive per Trac instance. You may be able to eliminate this using some mod_rewrite tricks.68 44 69 45 === Adding authentication === … … 72 48 73 49 {{{ 74 <LocationMatch / trac/[[:alnum:]]+/login>50 <LocationMatch /projects/[[:alnum:]]+/login> 75 51 AuthType Basic 76 52 AuthName "Trac"