| 66 | If 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 | |
| 68 | I use the following setup. |
| 69 | |
| 70 | I install Clearsilver: |
| 71 | {{{ |
| 72 | ./configure --prefix=$HOME/sw |
| 73 | make |
| 74 | make install |
| 75 | cp python/neo_cgi.so ~/sw/lib/python2.3/site-packages/ |
| 76 | }}} |
| 77 | |
| 78 | I install trac: |
| 79 | {{{ |
| 80 | ./setup.py install --prefix=$HOME/sw |
| 81 | cp ~/sw/share/trac/cgi-bin/trac.cgi ~/public_html |
| 82 | }}} |
| 83 | |
| 84 | I create ~/public_html/.htaccess (change "marcenuc" with your username): |
| 85 | {{{ |
| 86 | Options +ExecCGI |
| 87 | DirectoryIndex index.cs index.html |
| 88 | Action cs-handler /~marcenuc/static.cgi |
| 89 | AddHandler cs-handler .cs |
| 90 | AddType text/html .cs |
| 91 | |
| 92 | RewriteEngine On |
| 93 | RewriteBase /~marcenuc |
| 94 | |
| 95 | RewriteRule ^prj/?$ projects [R,L] |
| 96 | RewriteCond /home/marcenuc/.trac/prj/$1 -d |
| 97 | RewriteRule ^prj/([[:alnum:]]+)(/?.*) trac-wrapper.cgi/$1$2 [S=1] |
| 98 | RewriteRule ^prj/(.*) projects [R,L] |
| 99 | }}} |
| 100 | |
| 101 | I create ~/public_html/trac-wrapper.cgi (change "marcenuc" with your username) and make it executable: |
| 102 | {{{ |
| 103 | #!/bin/bash |
| 104 | user="marcenuc" |
| 105 | |
| 106 | prj="${PATH_INFO#/}" |
| 107 | prj="${prj%%/*}" |
| 108 | export TRAC_ENV="/home/${user}/.trac/prj/${prj}" |
| 109 | export SCRIPT_NAME="/~${user}/prj/${prj}" |
| 110 | export PATH_INFO="${PATH_INFO#/${prj}}" |
| 111 | export PYTHONPATH="/home/${user}/sw/lib/python2.3/site-packages" |
| 112 | |
| 113 | exec ./trac.cgi |
| 114 | }}} |
| 115 | |
| 116 | Create your projects repository and trac-environment: |
| 117 | {{{ |
| 118 | mkdir -p ~/.trac/{prj,svn} |
| 119 | svnadmin create ~/.trac/svn/myfirstproject |
| 120 | trac-admin ~/.trac/svn/myfirstproject initenv |
| 121 | }}} |
| 122 | |
| 123 | Open http://severname/~username/prj/myfirstproject |
| 124 | |
| 125 | ---- |