Edgewall Software

Changes between Initial Version and Version 1 of TracMultipleProjects


Ignore:
Timestamp:
May 23, 2004, 7:51:10 PM (20 years ago)
Author:
trac@…
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TracMultipleProjects

    v1 v1  
     1= Configure apache for multiple projects =
     2
     3By following these instruction you will get an Apache server that automatically handles multiple projects for you.
     4
     5Start out by creating an projects directory in your documentroot (/var/www in this example). Projects will be accessed by http://hostname/projects/projectname. Copy (or symlink) trac.cgi to this directory together with a file named index.html. This will be showed when users try to access non-existing projects.
     6
     7Then create your trac projects with trac-admin. It's important that they are all placed in the same directory. In this example we'll use /var/lib/trac. Edit you apache config and add this:
     8
     9{{{
     10RewriteEngine on
     11RewriteRule ^/projects/+$                       /projects/index.html [L]
     12RewriteCond /var/lib/trac/$1                    -d
     13RewriteRule ^/projects/([[:alnum:]]*)(/?.*)     /projects/trac.cgi$2 [S=1,E=TRAC_ENV:/var/lib/trac/$1]
     14RewriteRule ^/projects/(.*)                     /projects/index.html
     15
     16<Directory "/var/www/projects">
     17        AllowOverride None
     18        Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
     19        AddHandler cgi-script .cgi
     20        Order allow,deny
     21        Allow from all
     22</Directory>
     23
     24<Location "/projects/*/login">
     25        AuthType Basic
     26        AuthName "trac"
     27        AuthUserFile /path/to/trac.htpasswd
     28        Require valid-user
     29</location>
     30}}}
     31
     32Now, when you add another project, you don't need to edit any apache config. The only file you may want to edit is index.html to make it list the new project. If you think this is to much work, replace it with a php script that does it for you.