Edgewall Software

Changes between Version 2 and Version 3 of TracMultipleProjectsWindows


Ignore:
Timestamp:
May 12, 2005, 10:49:12 PM (19 years ago)
Author:
kevin.marino@…
Comment:

Updated formatting to be more consistent

Legend:

Unmodified
Added
Removed
Modified
  • TracMultipleProjectsWindows

    v2 v3  
    1 '''Global – Window Setup'''
     1== Global – Microsoft Windows Setup ==
     2
     3
    24This is the simplest case. With this procedure, you will be able to serve multiple Trac projects, using the same user accounts for every projects (permissions are still per project, but authentication is not). This procedure is based on the original procedure provided by the Trac team and the Initial install instructions at TracOnWindows.
    35
    4 Note: *nix based directory references may not work for all settings. Often times a *nix relative or absolute reference needs to be replace with the drive letter and path for it to work in a Windows environment. Often times this can solve problems.
     6  Note: *nix based directory references may not work for all settings. Often times a *nix relative or absolute reference needs to be replace with the drive letter and path for it to work in a Windows environment. Often times this can solve problems.
    57
    6 Assumptions:
    7         Default install drive C:
    8         Directories as set in TracOnWindows install guide
     8  Assumptions:
     9        Default install drive C:[[BR]]
     10        Directories as set in TracOnWindows install guide[[BR]]
    911        Configured not using a Virtual Host directive (am working on instructions for use of Virtual Host)
    1012
    11 Start out by creating a projects directory in your Document Root (C:/Program Files/Apache Group/Apache2/htdocs in this example). Projects will be accessed as http://hostname/projects/projectname. Create a directory in htdocs called, "projects". Copy trac.cgi to this projects/ directory together with a file named index.html (create if needed). This will be shown when users try to access nonexistent projects.
     13Start out by creating a {{{projects}}} directory in your Document Root (C:/Program Files/Apache Group/Apache2/htdocs in this example). Projects will be accessed as http://hostname/projects/projectname. Create a directory in htdocs called, {{{projects}}}. Copy trac.cgi to this {{{projects/}}} directory together with a file named index.html (create if needed). This will be shown when users try to access nonexistent projects.
    1214
    13 Next create your Trac projects with trac-admin. In the original *nix multiple repositories install instructions the Trac projects need to reside in the same directory. The reference to the directory is the physical path, In this example we'll use c:/svn/ . Add the following to your Apache configuration:
     15Next create your Trac projects with trac-admin. In the original *nix multiple repositories install instructions the Trac projects need to reside in the same directory. The reference to the directory is the physical path, In this example we'll use {{{c:/svn/}}} . Add the following to your Apache configuration:
    1416
     17{{{
    1518# RewriteCond removed at the moment since not needed
    1619# Notice paths are physical location on hard drives
     
    4649        Require valid-user
    4750</LocationMatch>
    48 Now, 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 too much work, replace it with a python cgi script that does it for you.
    49 tracd and TracModPython can also serve multiple projects.
    50 Suggestion: In the second RewriteRule directive and in the LocationMatch directive, change [[:alnum:]] to [^/] because while [[:alnum:]] only matches an alpha-numeric character, [^/] matches any character that is not a slash. This change allows for, among other things, hyphens in project/directory names. Another possibility is to replace [[:alnum:]] with [[:alnum:]\-], which matches only an alphanumeric character or a hyphen (the backslash "escapes" the hyphen, which would otherwise have special meaning). The Apache 2.0 mod_rewrite documentation suggests referencing the Perl regular expression manual page (run perldoc perlre on a system where Perl is installed) for details on regular expressions. Note that it may be preferable to use a pattern that matches only characters suitable for directory names (and, thus, project names) that are valid for your particular installation.
     51}}}
    5152
     53Now, 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 too much work, replace it with a python cgi script that does it for you.
     54
     55[wiki:TracStandalone tracd] and TracModPython can also serve multiple projects.
     56
     57'''Suggestion:''' In the second ''RewriteRule'' directive and in the ''LocationMatch'' directive, change {{{[[:alnum:]]}}} to {{{[^/]}}} because while {{{[[:alnum:]]}}} only matches an alpha-numeric character, {{{[^/]}}} matches any character that is not a slash.  This change allows for, among other things, hyphens in project/directory names.  Another possibility is to replace {{{[[:alnum:]]}}} with {{{[[:alnum:]\-]}}}, which matches only an alphanumeric character or a hyphen (the backslash "escapes" the hyphen, which would otherwise have special meaning).  The [http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html Apache 2.0 mod_rewrite documentation] suggests referencing the Perl regular expression manual page (run {{{perldoc perlre}}} on a system where Perl is installed) for details on regular expressions.  Note that it may be preferable to use a pattern that matches only characters suitable for directory names (and, thus, project names) that are valid for your particular installation.
     58