[users@httpd] rewrite rule not setting environment variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,
 
I'm been trying to setup multiple trac [http://projects.edgewall.com/trac/wiki/TracMultipleProjects] projects on my apache server.... I can get them working using some generic expressions, but not completly. This becomes a problem if we start to host lots of projects ie. i'd have to edit the create a new entry every time. At the moment, i've got 3 projects (ie. trac portals under a single domain)
 
The structure ends up like where oats,toy1,toy2 are the tracs.
 
TRAC1: www.oatsoft.org/trac/oats
TRAC2: www.oatsoft.org/trac/toy1
TRAC3: www.oatsoft.org/trac/toy2
 
and they all sit under the same folder on the harddrive. ie. c:\program files\subversion\trac\oats\ oats or toy1 or toy2...
 
 
Below, is the relevant block from the virtualhost in my conf file... i've added comments into the code with ##
 
The rewite rule i've tried does change the url, but doesn't seem to set the environment variable hence i've had to result to location and setenv block per project...Andy suggestions would be greatly appreciated.
 

....

## trac rules
  
 ## this is the way trac support recommend multiple projects
 ## so u only have to have one entry in here but i can't get this to work
 
 #RewriteRule ^/projects/([[:alnum:]]+)(/?.*) /projects/trac.cgi$2 [E=TRAC_ENV:/var/lib/trac/$1]
 #<LocationMatch "/projects/[[:alnum:]]+/login">
 # AuthType Basic
 # AuthName "trac"
 # AuthUserFile /path/to/trac.htpasswd
 # Require valid-user
 #</LocationMatch>
 
 ## this would be my equivalent rewrite rule, but fails... always says the env-var is not set!!
 
 #RewriteRule ^/trac/([[:alnum:]]+)(/?.*) http://www.oatsoft.org/cgi-bin/trac.cgi$2 [E=TRAC_ENV:"c:\\program\ files\\subversion\\trac\\oats"\\$1
 
 ## scriptaliasmatch is used as the alternative, and makes urls neater, but means i have to use
 ## a separate location block per project... okay for now, but with lots of projects... bad
 
 ScriptAliasMatch ^/trac/([[:alnum:]]+)(/?.*) cgi-bin/trac.cgi$2 
 <LocationMatch "/trac/[[:alnum:]]+/login">
  AuthType Basic
  AuthName "Trac Portal"
  AuthUserFile .htpasswd
  Require valid-user
 </LocationMatch>
  
 <Location "/trac/oats">  
  SetEnv TRAC_ENV "C:\Program Files\Subversion\trac\oats\oats"  
 </Location>  
 <Location "/trac/toy1">
  SetEnv TRAC_ENV "C:\Program Files\Subversion\trac\oats\toy1"  
 </Location>
 <Location "/trac/toy2">
  SetEnv TRAC_ENV "C:\Program Files\Subversion\trac\oats\toy2"
 </Location>
 <Location "/trac/mousefood">
  SetEnv TRAC_ENV "C:\Program Files\Subversion\trac\oats\mousefood"
 </Location>

....


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux