It's written in python. Oh, well. Nothing is perfect.
Here I'll be describing how to install trac v0.10 with the WebAdmin plugin on CentOS 5. We'll pretend to be installing it at http://myserver.org/trac/ (upcoming posts will talk about using and maintaining trac).
Start by installing the trac and python-clearsilver RPMs from the EPEL repositories. This will add the
/etc/httpd/conf.d/trac.conffile to your Apache configuration. I suggest replacing the default contents of that file with the following:
PythonOption TracEnvParentDir /var/www/trac/tracroot
PythonOption TracUriRoot /trac
SetEnv PYTHON_EGG_CACHE /var/www/trac/egg_cache
(Don't forget to restart Apache to make the new configuration take effect.)
I'll be putting all the trac files in
/var/www/trac(outside the Apache docroot at
/var/www/html). Each trac project will have its own directory in
/var/www/trac/tracroot, and the subversion repository will be at
The 'egg cache' (I guess that's some wierd Python drivel) will be at
/var/www/trac/egg_cache. The egg cache is for plugins. It's actually not necessary for the WebAdmin plugin, but you may as well set it up, anyway, in case you want to add other plugins. It needs to be Apache-writeable:
chown -R apache.apache /var/www/trac/egg_cache.
You'll notice that I've set up Basic Apache authentication. Use the command-line htpasswd command (part of the httpd package) to create and maintain the
/var/www/trac/htpasswd. In my case, I created a user called carl:
htpasswd -c /var/www/trac/htpasswd carl
If you want to use the Subversion integration, put your repository at
/var/www/trac/svn(either drop in a hotcopy or use
svnadmin load /var/www/trac/svn). Remember to make it Apache-writeable:
chown -R apache.apache /var/www/trac/svn.
To install the WebAdmin plugin, you'll need setuptools. Download ez_setup.py and run
python ez_setup.py(this is all described on the TracPlugins node of the trac wiki). This installs the
easy_install http://svn.edgewall.com/repos/trac/sandbox/webadminshould install the plugin (verify the URL on the WebAdmin wiki node). Now you'll need to enable the plugin by adding the following text to
/usr/share/trac/conf/trac.ini(this file probably doesn't exist yet, so you'll be creating it):
webadmin.* = enabled
You'll probably need another Apache restart at this point (editing
/usr/share/trac/conf/trac.iniseems to require an Apache restart).
And now we can actually create a trac project. We'll call it foo, for laughs:
trac-admin /var/www/trac/tracroot/foo initenv
This will ask you a few questions (I'm assuming that your Subversion repository is set up such that there's a foo item just under the repository root, and that it corresponds to this trac project):
- project name: keep this short but descriptive
- DB connection string: just use the default (SQLite)
- repository type: use the default if you're doing the Subversion integration
- repository path:
- templates: use the default
/var/www/trac/tracroot/foo/conf/trac.ini. You can later edit this file by hand, but if you change the repository location (the
repository_diritem), you'll need to run the following command:
trac-admin /var/www/trac/tracroot/foo resync
Now give yourself administrative rights to the project (using the same username you used with the
trac-admin /var/www/trac/tracroot/foo permission add carl TRAC_ADMIN
Well, this has already run pretty long, so I'll break for now. In the next exciting episode, I'll talk a bit about actually using trac.