Trac, WebAdmin plugin and global configuration

30 May 2007

As you may know I manage quite a few trac installations. A few days ago I upgrade my server from Ubuntu “Dapper Drake” 6.06 to Ubuntu “Feisty Fawn” 7.04. This also upgrade trac 0.9.x to 0.10.3.

I was happy, since trac 0.10.3 has many improvements over 0.9.x, but there was one thing I was not so happy about. After the upgrade, I upgraded all my trac installations and everything seemed to be okay, except for the WebAdmin plugin. Apparently it was not installed anymore.

What happened? After upgrading the trac package, the plugins directory was emptied. Well, just re-install the WebAdmin plugin for 0.10.x.

cd /usr/share/trac/plugins
sudo svn co http://svn.edgewall.org/repos/trac/sandbox/webadmin/
cd webadmin
sudo python setup.py bdist_egg
cd dist
sudo easy_install-2.4 TracWebAdmin-0.1.2dev_r4429-py2.4.egg
That was easy, next I wanted to enable the plugin for all my trac installations by adding the proper configuration to /usr/share/trac/conf/trac.ini, the global trac configuration file that is used by all trac installs.
[components]
webadmin.* = enabled
After restarting Apache (this is needed for some reason to get trac to read the new configuration file), no admin button showed up in any of the projects.

What went wrong is that Ubuntu (or Debian?) maintainers have changed the location of the global configuration file for trac. There are three solutions to this, all of them work fine, although I recommend you use the first one.

1. Move your global configuration

The best way to tackle this problem is to move your global configuration file to the new location: /etc/trac/trac.ini

sudo mv /usr/share/trac/conf/trac.ini /etc/trac/trac.ini
This way you’re configuration is safe from new upgrades and confirms to the defaults the package maintainer has set.

2. Symlink the configuration

If for some reason you don’t want to actually move your /usr/share/trac/conf/trac.ini file, you can create a symlink to the new location:

sudo ln -sf /usr/share/trac/conf/trac.ini /etc/trac/trac.ini

This leaves your original configuration file in tact, but it may be removed by new upgrades.

3. Change Trac

You may also change the location where trac looks for the configuration file. Open up /var/lib/python-support/python2.5/trac/siteconfig.py and change the following:

< default_conf_dir = ‘/etc/trac’
> default_conf_dir = ‘/usr/share/trac/conf’[/pre]

(Note: the > and < symbols mark what is removed and what is added to the file.)

In any case, reboot your web server and you should be good to go again.