Trac and SVN on subdomains

I finally figured out how to get trac and svn on their own subdomains since when I originally setup the web server awhile ago. The only thing that changes is the vhosts file. In that example it was “/etc/apache2/sites-available/svntrac”. Here’s what the file should look like now:


NameVirtualHost *:80


ServerAdmin you@domain.com
ServerName domain.com

DocumentRoot /var/www/

Options FollowSymLinks
AllowOverride None


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all


ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On



  ServerName svn.domain.com
   
   DAV svn
   SVNParentPath /svn

   AuthType Basic
   AuthName "Subversion Repository"
   AuthUserFile /path/to/svnauth


   Require valid-user


#   AuthzSVNAccessFile /path/to/svnaccess
  




   ServerName trac.domain.com

   

    SetHandler mod_python
    PythonHandler trac.web.modpython_frontend
    PythonOption TracEnvParentDir /trac
    PythonOption TracUriRoot /

   

   

    AuthType Basic
    AuthName "Trac"
    AuthUserFile /path/to/svnauth
    Require valid-user

   

Related posts:

  1. Getting two domains on one IP
  2. My Perfect Server
  3. Ubuntu Server Problems
  4. Alumni App
  5. Enable mod_rewrite

4 Comments So Far

  1. [...] thought about doing before, but haven’t taken the time to stop and set it up. After getting sub-domains working, this was a breeze, as it’s the same process. I’m working on an Ubuntu server, so this [...]

  2. wow this actually worked for my existing install @ /var/lib/trac/project
    i realized that u dont have a doc root
    i gues the doc root here is the python one
    so i was doing both and my apache was runing in a loop which does a 500
    i am not sure about teh /*/login part tho

  3. o yea almost forgot
    i left my login as /login like it was
    im not sure y ur doing a /*

    • The /*/login is because this server will be for more than one trac environment. Giving it that wild card means I only have to setup this file once and it will for every trac environment that i setup. If you’re only planning to run one trac environment on your server you can replace the * with the name of your trac instance, but that would be pointless since this way works and makes it more bullet-proof.

Leave a Reply