| 128 | Alternatively, instead of making a mess of your nice default vhost, why not take advantage of the vhost setup that unbuntu kindly has already set up for you. |
| 129 | |
| 130 | Make a new file called /etc/apache2/sites-available/trac and put this in it. |
| 131 | {{{ |
| 132 | <VirtualHost *> |
| 133 | ServerAdmin webmaster@localhost |
| 134 | ServerName trac.example.com |
| 135 | DocumentRoot /usr/share/trac/cgi-bin/ |
| 136 | <Directory /usr/share/trac/cgi-bin/> |
| 137 | Options Indexes FollowSymLinks MultiViews ExecCGI |
| 138 | AllowOverride All |
| 139 | Order allow,deny |
| 140 | allow from all |
| 141 | </Directory> |
| 142 | Alias /trac "/usr/share/trac/htdocs" |
| 143 | <Location /trac.cgi> |
| 144 | # You may need to customize this |
| 145 | SetEnv TRAC_ENV "/var/trac" |
| 146 | </Location> |
| 147 | |
| 148 | DirectoryIndex trac.cgi |
| 149 | ErrorLog /var/log/apache2/error.trac.log |
| 150 | CustomLog /var/log/apache2/access.trac.log combined |
| 151 | |
| 152 | </VirtualHost> |
| 153 | }}} |
| 154 | Note that you'll also need to make the following change to the apache2.conf file. (which some people don't like doing, I've never understood why not) Make sure that the {{{AddHandler}}} line is uncommented. |
| 155 | {{{ |
| 156 | # To use CGI scripts outside /cgi-bin/: |
| 157 | # |
| 158 | AddHandler cgi-script .cgi |
| 159 | }}} |
| 160 | And there you have it. Now you have your normal site left as before, running at www.example.com and your trac project running at trac.example.com. Feel free to go and play with the rewrite rules to pretty it up further, but now, back to the rest of the setup. |
| 161 | |