Edgewall Software

Changes between Version 13 and Version 14 of TracMultipleProjects


Ignore:
Timestamp:
Aug 5, 2004, 3:35:18 PM (20 years ago)
Author:
anonymous
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TracMultipleProjects

    v13 v14  
    6464
    6565----
     66If you have a normal account on a Unix server and you can have your own cgi-scripts launched by suExec, then you can setup trac to serve multiple projects. The main problem is that suExec cleans up your environment and "SetEnv TRAN_ENV ..." have no effect.
     67
     68I use the following setup.
     69
     70I install Clearsilver:
     71{{{
     72./configure --prefix=$HOME/sw
     73make
     74make install
     75cp python/neo_cgi.so ~/sw/lib/python2.3/site-packages/
     76}}}
     77
     78I install trac:
     79{{{
     80./setup.py install --prefix=$HOME/sw
     81cp ~/sw/share/trac/cgi-bin/trac.cgi ~/public_html
     82}}}
     83
     84I create ~/public_html/.htaccess (change "marcenuc" with your username):
     85{{{
     86Options +ExecCGI
     87DirectoryIndex index.cs index.html
     88Action cs-handler /~marcenuc/static.cgi
     89AddHandler cs-handler .cs
     90AddType text/html .cs
     91
     92RewriteEngine On
     93RewriteBase /~marcenuc
     94
     95RewriteRule ^prj/?$                     projects [R,L]
     96RewriteCond /home/marcenuc/.trac/prj/$1 -d
     97RewriteRule ^prj/([[:alnum:]]+)(/?.*)   trac-wrapper.cgi/$1$2 [S=1]
     98RewriteRule ^prj/(.*)                   projects [R,L]
     99}}}
     100
     101I create ~/public_html/trac-wrapper.cgi (change "marcenuc" with your username) and make it executable:
     102{{{
     103#!/bin/bash
     104user="marcenuc"
     105
     106prj="${PATH_INFO#/}"
     107prj="${prj%%/*}"
     108export TRAC_ENV="/home/${user}/.trac/prj/${prj}"
     109export SCRIPT_NAME="/~${user}/prj/${prj}"
     110export PATH_INFO="${PATH_INFO#/${prj}}"
     111export PYTHONPATH="/home/${user}/sw/lib/python2.3/site-packages"
     112
     113exec ./trac.cgi
     114}}}
     115
     116Create your projects repository and trac-environment:
     117{{{
     118mkdir -p ~/.trac/{prj,svn}
     119svnadmin create ~/.trac/svn/myfirstproject
     120trac-admin ~/.trac/svn/myfirstproject initenv
     121}}}
     122
     123Open http://severname/~username/prj/myfirstproject
     124
     125----
    66126See also: TracGuide, TracInstall