Changes between Initial Version and Version 1 of ThisTracInstallation


Ignore:
Timestamp:
27/09/13 21:13:20 (8 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ThisTracInstallation

    v1 v1  
     1{{{
     2#!rst
     3
     4Trac Installation on tools.ietf.org
     5===================================
     6
     7Background
     8----------
     9
     10The Track installation used on the tools.ietf.org site is different from the
     11installation examples provided with Trac and on http://trac.edgewall.com.  The
     12reason is mainly that the multi-project examples all assume that Trac
     13constitutes the whole of the deployed environment, rather than being part of a
     14greater set.  This means that the examples assume that accessing the
     15individual projects through URLs of the form "/$some_path/trac/$projname"
     16makes sense, while in our case, we would like the URLs to look like
     17"/$some_path/$projname/trac".  In the multi-project configuration, this would
     18make Trac always believe that the project name is 'trac' - the last path
     19component.
     20
     21Explored Alternatives
     22---------------------
     23
     24Make Apache set ``TRAC_ENV`` dynamically
     25........................................
     26
     27Tell Apache to dynamically set Trac's environment variable ``TRAC_ENV`` to the
     28particular value for the accessed project:
     29
     30``/etc/apache2/sites-available/tools.ietf.org``:
     31
     32::
     33
     34    ScriptAliasMatch "^/wg/[^/]+/trac(/.*)?" /usr/share/trac/cgi-bin/trac.cgi$1
     35    <LocationMatch "^/wg/([^/]+)/trac">
     36       SetEnv TRAC_ENV "/www/tools.ietf.org/tools/trac/wg/$1"
     37    </LocationMatch>
     38
     39This doesn't work because Apache doesn't support $n replacements based on
     40earlier LocationMatch matches.
     41
     42Use .htaccess with default ScriptAlias
     43......................................
     44
     45Maybe we could use individual .htaccess files in each WG directory to set the
     46``TRAC_ENV`` variable to the required value?
     47
     48``/etc/apache2/sites-available/tools.ietf.org``:
     49
     50::
     51
     52    ScriptAliasMatch "^/wg/[^/]+/trac(/.*)?" /usr/share/trac/cgi-bin/trac.cgi$1
     53
     54
     55``/www/tools.ietf.org/wg/examplewg/.htaccess``:
     56
     57::
     58
     59    SetEnv TRAC_ENV "/www/tools.ietf.org/wg/examplewg/trac"
     60
     61This doesn't work because this .htaccess isn't read when ScriptAlias points to
     62another directory.
     63
     64
     65Use .htaccess with a local CGI script
     66.....................................
     67
     68Suppose we let ScriptAlias point to a script which is placed so that the
     69.htaccess file actually gets read?
     70
     71``/etc/apache2/sites-available/tools.ietf.org``:
     72
     73::
     74
     75    ScriptAliasMatch "^/wg/([^/]+)/trac(/.*)?" /www/tools.ietf.org/wg/$1/trac/index.cgi$2
     76
     77
     78``/www/tools.ietf.org/wg/examplewg/.htaccess``:
     79
     80::
     81
     82    SetEnv TRAC_ENV "/www/tools.ietf.org/wg/examplewg/trac"
     83
     84This *does* work, but it is not easily adapted to a Fast-CGI solution.  It is
     85the set-up which is currently in use, but an alternative which will permit
     86fast-cgi usage would be preferred - the current solution is anything but
     87snappy...
     88
     89
     90
     91
     92
     93
     94}}}