DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Trac Installation On Its Own Subdomain

12.29.2005
| 6795 views |
  • submit to reddit
        Most installation documents of Trac show how to install to a directory in the main site's domain. For installation into a subdomain, the Trac data and CGI script should be installed into trac.domain.com/htdocs/trac/, with the following in the Apache config file:

<Directory /path/to/trac.domain.com/htdocs/trac/>
  AllowOverride None
  Options ExecCGI
  AddHandler cgi-script .cgi
  Order allow,deny
  Allow from all
</Directory>

<VirtualHost 1.2.3.4>
  ServerName trac.domain.com
  DocumentRoot /path/to/trac.domain.com/htdocs/

  RewriteEngine On
  RewriteCond %{REQUEST_URI} !^/cgi-bin/
  RewriteCond %{REQUEST_URI} !^/trac/
  RewriteRule ^/(.*) /trac/trac.cgi/$1 [L]

  <Location />
    SetEnv TRAC_ENV "/var/lib/trac/projname">
  </Location>
</VirtualHost>