Trac setup

Posted by Graham Stratton Thu, 15 Feb 2007 17:39:06 GMT

Just in case I haven’t already expressed my opinion on this: trac is wonderful. It’s a simple integration of subversion with an issue tracker and a wiki. It’s probably not that difficult to set up by default, but for some reason I chose to use Postgres instead of SQLite, so there’s a little bit to it. I covered installing everything elsewhere, so here I’m just going to describe setting up the database and configuring it all.

First we need to create a subversion repository. This needs to be writable by the user which Apache is running as, probably www-data or similar.

sudo svnadmin create /var/svn/hippocms
sudo chown -R www-data /var/svn/hippocms/

Now we need to configure Apache:

  <Location /svn>
    DAV svn
    SVNParentPath /var/svn
    AuthType Basic
    AuthName "Subversion" 
    AuthUserFile /etc/svn-auth
    Require valid-user
  </Location>

The SVNParentPath variable makes all the subdirectories of this directory which should be repositories available, but denies access to the directory itself.

We’re only protecting the repository with BasicAuth here; you’ll need to use https to make this secure. We need to create the htpasswd file:

sudo htpasswd -c /etc/svn-auth graham

So now, you should be able to access the repository through the web at http://your.server/svn/hippocms/

And you should be able to check out its emptyness with
svn co http://cambridgewebdevelopment.co.uk/svn/hippocms/

Next we set up the Apache to host trac:

  Alias /trac "/usr/share/trac/htdocs" 

  ScriptAlias /hippocms /usr/share/trac/cgi-bin/trac.cgi
  <Location "/hippocms">
    SetEnv TRAC_ENV "/var/trac/hippocms" 
    AuthType Basic
    AuthName "hippocms" 
    AuthUserFile /var/trac/hippocms/.htpasswd
    Require valid-user
  </Location>
And we need to add a user for Apache to authenticate:
sudo htpasswd -c /var/trac/hippocms/.htpasswd graham

Finally we need to create a database and create a trac user:

sudo su - postgres -c createdb hippocms
sudo su - postgres -c psql hippocms
# create user trac with password 'secret';

Now we’re ready to initialise our trac environment:

sudo trac-admin /var/trac/hippocms initenv

And everything should Just Work.

Posted in  | 11 comments

Comments

  1. Sean Tierney said 194 days later:

    Graham, thanks for the tutorial. For a truly “it just works” setup experience check out the JumpBox for Trac/SVN-> http://www.jumpbox.com/jumpbox-for-tracsubversion-software-project-management

    1min install and fully portable.

    sean

  2. Anime News said 400 days later:

    I’ve been using it with SQLite… But with this handy tutorial maybe it’s time to move to postgres :)

    Thanks mate.

  3. rapidshare torrent said 963 days later:

    and everything just works indeed! thanks a lot for posting this! useful and much appreciated:)

  4. replica watches said 1121 days later:

    thanks for the share

  5. du hoc uc said 1130 days later:

    Good post, thank you for sharing.

  6. automotive condensers said 1166 days later:

    where is the best place to learn programming cause i found it interesting.

  7. Tiffany silver jewelry said 1169 days later:

    That sound s good.I will try.And I am trying to search Tiffany Jewelry online store

  8. Contact Center said 1204 days later:

    Trac is a project management and bug-tracking tool, and it is an open source tool. Trac is a compact subversion with an issue tracker and wiki. Python programming language is used in this tool. The major features of trac are project management, ticket system, fine-grained permissions, timeline of recent activity, wiki, customized reporting, VCS web interface, RSS feeds, multiple project support, environment extensibility through python plug-in and icalender export. The project management includes road map, mile stones etc. the ticket system consist of bus tracking, tasks etc. to set up trac first we need to configure apache web server. Next step is to set up apache to host trac.

  9. xenon light said 1284 days later:

    Well, the article is actually the sweetest topic on this related issue. I fit in with your conclusions and will thirstily look forward to your forthcoming updates. Saying thanks will not just be sufficient, for the tremendous lucidity in your writing. I will immediately grab your rss feed to stay privy of any updates.

  10. fm stereo transmitter said 1284 days later:

    I was just doing some web browsing on my Garmin Phone during my break at my work place, and I came across something I thought was interesting . It linked over to your website so I clicked over. I can’t really find the relevance between your site and the one I came from, but your site good none the

    less.thanks for sharing thoes informations , It is interesting, i like it!

  11. marc jacobs duffle said 1295 days later:

    Thanks for sharing,it is useful!

(leave url/email »)

   Comment Markup Help Preview comment