I'm going to be running multiple subdomains, eventually too many to be able to each have their own config files. I have the vhosts working how I want them so each subdomain has their own folder eg /web/test which will serve webpages for that subdomain. I want to have each subdomain have its own SVN and trac project eg http ://test.mastersiege.com/trac the problem is you cant use variables in apache.
<Location /trac>
   SetHandler mod_python
   PythonInterpreter main_interpreter
   PythonHandler trac.web.modpython_frontend 
   PythonOption TracEnv /var/trac/$1
   PythonOption TracUriRoot /trac
</Location>
where $1 = subdomain. and I cant sym link the trac folder into the subdomains home folder and then use vhost_alias's doc root as TracEnv. I tried writing a Perl script in the apache config files which parses the subdomain from the URL much like Using URL within Vhost container with mod_perl dynamically but It didnt work
            use Apache2::ServerRec () ;
            use Apache2::ServerUtil ();
            use Apache2::RequestRec ();
            use Apache2::RequestUtil ();
            use Apache2::Const qw/OK DECLINED/;
            my $s = Apache2::ServerUtil->server;
            $s->push_handlers(PerlHeaderParserHandler => sub { my($r) = @_;
            if ( $r->hostname =~ m/(.*)\.([^.]+\.\w+)$/ ) {
            my($subdomain,$domain) = ($1,$2);
            my($TracPath) = "TracEnv /srv/trac/"+$subdomain;
            my($TracUri) = "TracUriRoot /testTrac";
            $Location{"/testTrac/"} = {
            SetHandler => "mod_python",
            PythonInterpreter => "main_interpreter",
            PythonHandler => "trac.web.modpython_frontend",
            PythonOption => $TracPath,
            PythonOption => $TracUri
            };
            if ( $@ ) { warn $@ }
            return OK;
            } else {
            return DECLINED;
            }
            });
    </Perl>
Thats my first ever perl script so Im unsure.. It is possible to use cgi for trac which would solve the problem but it its about 100x slower then mod_python