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

  • 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, with the following in the Apache config file:

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

  DocumentRoot /path/to/

  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">