Edgewall Software

Changes between Initial Version and Version 1 of TracLitespeed


Ignore:
Timestamp:
Feb 12, 2006, 8:36:10 AM (18 years ago)
Author:
ucosty@…
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TracLitespeed

    v1 v1  
     1= Basic Multiproject under Litespeed =
     2
     3This document specifies how to modify an existing Trac setup to work with [http://litespeedtech.com/ Litespeed]. It assumes you have a working Trac install which can serve single Trac projects using the tracd server.
     4
     5This document assumes some default paths, such as
     6 * /usr/share/trac/
     7 * /usr/lib/python-[ver]/site-packages/trac/
     8for the basic Trac installation.
     9
     10This document _also_ assumes you wish to setup Trac to use a dedicated subdomain. It should be trivial, however, to change this behaviour.
     11
     12== Allowing project-based URL's in Trac ==
     13
     14Edit the Trac main.py file. On Linux this file can be found in /usr/lib/python-[ver]/site-packages/trac/web/main.py where [ver] is replaced with your python version (such as 2.4).
     15
     16Replace the line
     17{{{
     18env.href = Href(req.cgi_location)
     19}}}
     20with
     21{{{
     22env.href = Href(req.base_url)
     23}}}
     24save and exit
     25
     26This modification allows Trac to generate URL's based on the __project path__ rather than the cgi path.
     27
     28You will also need to add the following line to each of your project's trac.ini files manually.
     29
     30Under [trac] add
     31{{{
     32base_url = /projects/[projectname]
     33}}}
     34
     35The following example will make the 'test' project accessable at http://yourdomain.tld/projects/test
     36{{{
     37base_url = /projects/test
     38}}}
     39
     40== Creating Litespeed Config ==
     41
     42Using the Litespeed configuration panel
     43
     44 * Create a Trac virtual host
     45   * Enable scripting and Symlink Following support
     46 * Enable URL rewrite support
     47 * Insert the following rewrite rules
     48{{{
     49RewriteRule ^/projects/([[:alnum:]]+)(/?.*)     /trac.cgi$2 [S=1,E=TRAC_ENV:/trac/$1,E=TRAC_URI_ROOT:/projects/$1]
     50RewriteRule ^/projects/(.*)                     /index.html
     51}}}
     52 * Add a Static context with the following
     53   * URI: /trac.cgi/chrome/common
     54   * Location: /usr/share/trac/htdocs
     55   * Accessible: Yes
     56   * Enable Expires: No
     57
     58 * Create a CGI context with the following
     59   * URI: /
     60   * Path: /usr/share/trac/cgi-bin/
     61
     62 * Save and reload Litespeed
     63
     64This will make project accessable through the address
     65{{{
     66http://subdomain.domain.tld/projects/[projectname]
     67}}}