Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a debian lenny server with trac (bug tracking system) installed which uses apache, i want to add another tool called rt (request tracker). Got everything working except that i can´t load them both simultaneously. Any thing i try on virtual hosts end up making only one of the work.

This the rt virtualhost that works for me:

<VirtualHost *:80>
   ServerName todasana.fondoavila.com

DocumentRoot /opt/rt3/share/html
PerlRequire "/opt/rt3/bin/webmux.pl"

<Location /rt>
    AddDefaultCharset UTF-8
    SetHandler perl-script
    PerlResponseHandler RT::Mason
</Location>
</VirtualHost>

this is the default virtual host where i have trac installes

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www/

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

TRAC Root : http://server/trac or http://server/trac/

    # Rewrite ./trac to ./trac/
    RewriteEngine on
    RewriteRule ^(.*)\/trac$ $1/ [NC]

<Location /trac/>
    SetHandler mod_python
    PythonHandler trac.web.modpython_frontend
    PythonInterpreter main
    PythonOption TracEnvParentDir /var/trac/env
    PythonOption TracUriRoot /trac
    SetEnv PYTHON_EGG_CACHE /tmp
</Location>

### TRAC Login : http://server/trac/*/login
<LocationMatch ^(/trac/[^/]+)?/login>
    AuthType Basic
    AuthName "TRAC Login"
    AuthUserFile /etc/apache2/passwd-trac
    Require valid-user
</LocationMatch>

### SVN repository : http://server/svn
<Location /svn>
    DAV svn
    SVNParentPath /var/svn-repos/catwizard3
    SVNListParentPath on

    AuthType Basic
    AuthName "SVN Repository"
    AuthUserFile /etc/apache2/passwd-trac
    Require valid-user
</Location>

Any solution would be much appreciated! thank you!

share|improve this question
    
Is the trac config you've listed meant to be inside the second VirtualHost container? Or is it in an .htaccess file inside the trac root? Also, do you want these available on separate hostnames (e.g. rt.fondoavila.com and trac.fondoavila.com), or from the same hostname? Your config seems to suggest you want them on the same host at todasana.fondoavila.com/rt and todasana.fondoavila.com/trac - if this is the case, they should be in the same VirtualHost. Answer these questions and I should be able to help you sort out your config. –  John Dalton Apr 10 '11 at 3:27
    
Hello John, thank you very much for the help! i need them on the same host, just like you propose HOTS/rt and HOTS/trac. The files i posted are from different VirtualHost containers. Thankyou! –  Ernest Apr 10 '11 at 15:55

1 Answer 1

#order matters
#DNS or your hosts file must be set correctly
<VirtualHost *:80>
   ServerName trac.fondoavila.com
   #all trac config here
</VirtualHost>

<VirtualHost *:80>
   ServerName todasana.fondoavila.com
   #all rt config here
</VirtualHost>

Using this setup if you goto todasana.fondoavila.com the rt stuff will be returned. If you goto to trac.fondavila.com (or another other hostname or IP pointing to this box) you'll get the trac stuff. ServerName is the thing the determines how the request will be serviced.

Also anything outside of the VirtualHost sections will be applied if not overridden so make sure you don't have any rewrite rules or anything else there that might mess things up.

share|improve this answer
    
Hello mathhew, thank you very much for your answer, but i need a solutions that works for the same hostname, something like: todasana.fondoavila.com/rt and todasana.fondoavila.com/trac. Thank you very much for your answer –  Ernest Apr 10 '11 at 15:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.