Changes between Version 3 and Version 4 of TracModPython


Ignore:
Timestamp:
07/21/09 09:05:27 (15 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracModPython

    v3 v4  
    1313}}}
    1414
    15  ''Note: The exact path to the module depends on how the HTTPD installation is laid out.''
     15''Note: The exact path to the module depends on how the HTTPD installation is laid out.''
     16
    1617On Debian using apt-get
    1718{{{
     
    5758    PythonOption TracEnvParentDir /var/trac/myprojects
    5859    # For the index of multiple projects
    59     PythonOption TracEnvIndexTemplate /srv/www/htdocs/trac/project_list_tepmlate.html
     60    PythonOption TracEnvIndexTemplate /srv/www/htdocs/trac/project_list_template.html
    6061    # A space delimitted list, with a "," between key and value pairs.
    6162    PythonOption TracTemplateVars key1,val1 key2,val2
     
    6465    # See description above       
    6566    PythonOption TracUriRoot /projects/myproject
     67}}}
     68
     69=== Python Egg Cache ===
     70
     71Compressed python eggs like Genshi are normally extracted into a directory named `.python-eggs` in the users home directory. Since apache's home usually is not writable an alternate egg cache directory can be specified like this:
     72{{{
     73PythonOption PYTHON_EGG_CACHE /var/trac/myprojects/egg-cache
    6674}}}
    6775
     
    217225}}}
    218226
    219 if you have issues with login try using `<LocationMatch>` instead of `<Location>`
     227This does not seem to work in all cases. What you can do if it does not:
     228 * Try using `<LocationMatch>` instead of `<Location>`
     229 * <Location /> may, in your server setup, refer to the complete host instead of simple the root of the server. This means that everything (including the login directory referenced below) will be sent to python and authentication does not work (i.e. you get the infamous Authentication information missing error). If this applies to you, try using a sub-directory for trac instead of the root (i.e. /web/ and /web/login instead of / and /login).
    220230
    221231For a virtual host that supports multiple projects replace "`TracEnv`" /var/trac/myproject with "`TracEnvParentDir`" /var/trac/
    222232
    223 Note: !DocumentRoot should not point to your Trac project env. As Asmodai wrote on #trac: "suppose there's a webserer bug that allows disclosure of !DocumentRoot they could then leech the entire Trac environment".
     233Note: !DocumentRoot should not point to your Trac project env. As Asmodai wrote on #trac: "suppose there's a webserver bug that allows disclosure of !DocumentRoot they could then leech the entire Trac environment".
    224234
    225235== Troubleshooting ==
     
    261271
    262272It may be possible to work around this with mod_rewrite, but I failed to get this working. In all, it is more hassle than it is worth. Stick to the provided instructions. :)
     273
     274A success story: For me it worked out-of-box, with following trivial config:
     275{{{
     276SetHandler mod_python
     277PythonInterpreter main_interpreter
     278PythonHandler trac.web.modpython_frontend
     279PythonOption TracEnv /system/path/to/this/directory
     280PythonOption TracUriRoot /path/on/apache
     281
     282AuthType Basic
     283AuthName "ProjectName"
     284AuthUserFile /path/to/.htpasswd
     285Require valid-user
     286}}}
     287
     288The TracUriRoot is obviously the path you need to enter to the browser to get to the trac (e.g. domain.tld/projects/trac)
     289
     290=== Additional .htaccess help ===
     291
     292If you are using the .htaccess method you may have additional problems if your trac directory is inheriting .htaccess directives from another.  This may also help to add to your .htaccess file:
     293
     294{{{
     295<IfModule mod_rewrite.c>
     296  RewriteEngine Off
     297</IfModule>
     298}}}
     299
    263300
    264301=== Win32 Issues ===
     
    339376
    340377----
    341 See also TracGuide, TracInstall, TracCgi, TracFastCgi
     378See also:  TracGuide, TracInstall, [wiki:TracModWSGI ModWSGI], [wiki:TracFastCgi FastCGI], [wiki:TracModPython ModPython], [trac:TracNginxRecipe TracNginxRecipe]