Installing Trac (with Git) in Fedora 15 [part 1]

Okay, all the documentation I found was hideously out of date. I needed this for my final year project (keeping track of my project in trac) and so here is how to install and setup trac in Fedora.

$ su -#yum install trac trac-git-plugin

This will install (but not setup in any way) trac and the trac git plugin. Next you need to change directory (or make a directory) where you would like your new trac instance to be stored.

$cd /home/webpigeon
$mkdir trac
$cd trac

Now we run trac-admin to create our trac instance. This will then be used for running our trac server. We’ll then launch the trac instance and check if it’s accessible on the web (by going to localhost:8000)

$ trac-admin /home/webpigeon/trac initenv
$ tracd -s –port 8000 /home/webpigeon/trac

Going onto localhost:8000, you should now see your shiny new trac instance is running. We now have a trac instance we can run (sort of) it’s still using svn and it will moan about not having any accounts if you try to use it.

Interestingly, trac doesn’t actually manage it’s own user accounts… it lets the web server do that for it (http authentication). As we’re going to be using tracd rather than apache to run this (it’s only a small project after all) we’ll have create some accounts and tell trac about them.

I’ve got the apache packages installed even though I’m not using apache, so I have access to the apache “htdigest” command. This allows us to create accounts in a format that trac will understand (http digest). I’m putting my users file in conf/users.digest because that’s the recommended place to put it, but you can put it anywhere. The command accepts a ‘-c’ flag, which will create the file. You can then add as many users as you want by calling the command without the ‘-c’ flag. Each time you run the command it will ask you what you want the users password to be.

We’ll then use trac-admin to give a user admin rights, which will allow them to manage the website from the front-end (so I’m told – I’ve haven’t played with that yet). You can also manage trac from the command line using trac-admin directly (how I’ve been doing it).

$ htdigest -c /home/webpigeon/trac/conf/users.digest trac webpigeon
$ htdigest /home/webpigeon/trac/conf/users.digest trac battwa
$ trac-admin /home/webpigeon/trac permission add webpigeon TRAC_ADMIN

Now we have some user accounts, we can start tracd and tell it about the password file. The syntax for this is a little odd. From what I can figure out the first part is the trac instance you want the passwords to be for, as I’m not that fussed I’ve said all of them using a ‘*’. The second part is where the file is stored and the 3rd part is the authentication realm, I’ve just set this as “trac”.

$ cd /home/webpigeon/trac
$ tracd –port 8000 –auth=”*,config/users.digest,trac” /home/webpigeon/trac

You now have a working trac instance with SVN. I’ll publish the stuff regarding how to get git working later. This is a long enough post already. EDIT I’ve amended the post with corrections mentioned by isorfir in the comments.

2 thoughts on “Installing Trac (with Git) in Fedora 15 [part 1]”

  1. Thanks for posting this. I followed it to install Trac on my Fedora 15 VM. Couple of comments. Your first htdigest code example doesn't include the realm, it should be '$ htdigest -c /home/webpigeon/trac/conf/users.digest trac webpigeon'

    Your last code example lists config/users/digest where the directory is /conf. Also, I changed it to port 8000 to stay consistent: '$ tracd –port 8000 –auth="*,conf/users.digest,trac" /home/webpigeon/trac'

    I'd like to continue on and get Git working, any idea when part 2 is coming out?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.