Edgewall Software

Changes between Version 4 and Version 5 of ApacheSuexec


Ignore:
Timestamp:
Mar 9, 2005, 9:32:16 AM (19 years ago)
Author:
torgny@…
Comment:

Added information about how to make multiple projects work under Plesk and suEXEC for same domain projects. The other example merely added one repository browser per user, not what I wanted.

Legend:

Unmodified
Added
Removed
Modified
  • ApacheSuexec

    v4 v5  
    4444}}}
    4545
     46
     47== Multiple Projects under Plesk/suEXEC/same domain ==
     48
     49'''Added by torgny at sbbs.se'''
     50
     51The above script works well if you want to have a Trac
     52instance for each user, but it does not really help if you have
     53several projects under the same site. In order to solve this under
     54Linux Red Hat with Plesk, I did the following:
     55
     56First, from the Apache configuration ('''vhost.conf''' in this case),
     57replace '''DOMAIN''' with the domain you are adding:
     58{{{
     59RewriteEngine on
     60RewriteRule ^/projects/+$                                    /projects/index.php  [L]
     61RewriteCond /home/httpd/vhosts/DOMAIN/private/tracs/$1  -d
     62RewriteRule ^/projects/([^/]+)(/?.*)                         /projects/wrap.cgi$2 [S=1,E=TRAC_ENV:/home/httpd/vhosts/DOMAIN/private/tracs/$1]
     63RewriteRule ^/projects/(.*)                                  /projects/index.php
     64
     65Alias /trac/ /usr/share/trac/htdocs/
     66
     67<Directory "/usr/share/trac/htdocs">
     68    Options Indexes MultiViews
     69    AllowOverride None
     70    Order allow,deny
     71    Allow from all
     72</Directory>
     73
     74<Directory "/home/httpd/vhosts/DOMAIN/httpdocs/projects">
     75    AllowOverride None
     76    Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
     77    AddHandler cgi-script .cgi
     78    Order allow,deny
     79    Allow from all
     80</Directory>
     81
     82<LocationMatch "/projects/[[:alnum:]]+/login">
     83    AuthType Basic
     84    AuthName "Trac"
     85    AuthUserFile /home/httpd/vhosts/DOMAIN/private/.htpasswd_trac
     86    Require valid-user
     87</LocationMatch>
     88}}}
     89
     90And after that, add the folder to '''~/httpdocs/projects'''.
     91
     92In that folder, either symlink '''trac.cgi''' or place a copy, and add '''index.html'''.
     93
     94Index.php acts as the default page when a project without an existing
     95Trac environment is requested.
     96
     97Now, for the wrap.cgi bash script:
     98{{{
     99#!/bin/bash
     100project="${SCRIPT_NAME#/projects/}"
     101export TRAC_ENV="/home/httpd/vhosts/DOMAIN/private/tracs/${project}"
     102export SCRIPT_NAME="/projects/${project}"
     103export PATH_INFO="${PATH_INFO#/${SCRIPT_NAME}}"
     104exec ./trac.cgi
     105}}}
     106
     107The script above does all the work-around magic to make sure everything
     108works between suEXEC and Trac in CGI mode. It also gives you multiple
     109projects support.
     110
    46111----
    47112See also: TracInstall, TracMultipleProjects