Edgewall Software

Changes between Version 12 and Version 13 of TracModPython


Ignore:
Timestamp:
Feb 24, 2005, 5:19:24 PM (19 years ago)
Author:
Christopher Lenz
Comment:

Use SetHandler None instead of a regexp in the "root of virtual host" setup

Legend:

Unmodified
Added
Removed
Modified
  • TracModPython

    v12 v13  
    5252
    5353{{{
    54 <LocationMatch "^/(?!trac/)">
    55    SetHandler mod_python
    56    PythonHandler trac.ModPythonHandler
    57    PythonOption TracUriRoot "/"
    58    PythonOption TracEnv /var/trac/myproject
    59 </LocationMatch>
     54<VirtualHost trac.example.org>
     55  ServerName trac.example.org
     56  Alias /trac /var/www/trac.example.org/htdocs/trac
     57  <Location />
     58    SetHandler mod_python
     59    PythonHandler trac.ModPythonHandler
     60    PythonOption TracUriRoot "/"
     61    PythonOption TracEnv /var/trac/myproject
     62  </Location>
     63  <Location /login>
     64    AuthType Basic
     65    AuthName "My Project"
     66    AuthUserFile /var/trac/myproject/.htaccess
     67    Require valid-user
     68  </Location>
     69  <Location /trac>
     70    SetHandler None
     71  </Location>
     72</VirtualHost>
    6073}}}
    6174
    62 The regular expression used in the !LocationMatch directive permits clients to escape mod_python and access Trac "real" files (located at {{{/var/www/some-hostname/htdocs/trac/}}} on the filesystem). Any other URLs will be handled by mod_python.
     75The path in the last {{{<Location>}}} block should match your {{{htdocs_location}}}. The directive "{{{SetHandler None}}}" allows us to escape mod_python and have Apache serve the static files (located at {{{/var/www/trac.example.org/htdocs/trac/}}} on the filesystem in this example). Any other URLs will be handled by mod_python.
    6376
    6477== Setting up multiple projects ==