Install Trac on Windows XP

According to the website:
Trac is an enhanced wiki and issue tracking system for software development projects. Trac uses a minimalistic approach to web-based software project management.

Trac is developped in Python and can run on Microsoft Windows XP (as other platforms).

  1. Introduction
  2. Installation
  3. Customization
  4. Expanding Trac

1. Introduction

According to the website:
Trac is an enhanced wiki and issue tracking system for software development projects. Trac uses a minimalistic approach to web-based software project management.

Trac is developped in Python and can run on Microsoft Windows XP (and all other)

Trac contains a

  • Wiki: to collect information regarding the project, e.g. Contact List, links, documentation…
  • Timeline: how many bugs to reach the next milestone
  • Graphical Interface to Subversion, a control-Versioning System (like MS Sourcesafe) [Optional]
  • Tickets Management System to follow questions, feedback… from the customer.
  • Interface to a Control Version system like Subversion [Optional]
  • Web interface (Trac provides a minimalist web server)This software is dedicated to developper teams that need to keep several versions of their software or documents and to keep trace of information and customer calls. Its minimalist view and opensource License (a modified BSD License) will permit the team to integrate the tool to other tools.

2. Installation

The Trac Wiki is proposing a page explaining how to install Trac on Windows. As I was not able to use this page (no internet Access in the VM is a reason), I have found my own way.

First of all, you will need the following software:

Create the following directories:

  • C:\MyProject
  • C:\Scripts
  • C:\SVN\EnBW
  • Install Subversion 1.4.3
  • Install TortoiseSVN 1.4.3.8645
  • Create a SVN Repository in C:\SVN\EnBW
    You can use the Native Filesystem (FSFS)
  • Install Python 2.4.4Insert c:\python24 in your PATH (My ComputerPropertiesAdvancedEnvironment Variables)
  • Install Svn-python-1.4.3.win32-py2.4
  • Install pysqlite-2.3.3.win32-py2.4.exe
  • Install clearsilver-0.9.14.win32-py2.4.exe
  • Install Trac 0.10.3.1.win32
  • Create C:\Trac
  • Execute python c:\python24\scripts\trac-admin C:\trac initenv
    • Project Name: MyProject
    • [Enter] to create a SQLlite database db/Trac.db
    • [Enter] Repository type = SVN
    • Path to repository: C:\SVN\EnBW\KWG\Konv
    • [Enter] Template Directory: C:\Python24\share\trac\Templates

At this time the script creates the wiki and other pages for Trac

You can configure your environment through the file C:\Trac\conf\trac.ini

3. Customization

3.1. Define an administrator

I recommend you to give full administration rights to one of the users.
Run the command python C:\Python24\Scripts\trac-admin C:\trac permission add lolo TRAC_ADMIN to give administrator rights to the user lolo.

3.2. Scripts

Copy these scripts and create Shortcuts on the desktop

Create_Users.bat – Create users:
The following script will create a user lolo with a password lolo. To recreate the file C:\MyProject\users.htdigest with other users, just delete the file and rerun your customized file.

  @echo off

  echo Add Users for MyProject Trac Project

  echo .  rem start tracd with --auth option

  rem Use the option --auth

  rem python C:\Python24\Scripts\tracd --port 8000 --auth trac,C:\MyProject\users.htdigest,trac c:\trac

python trac-digest.py -u lolo -p lolo >> C:\MyProject\users.htdigest

  The daemon ``Tracd`` can serve static content.

  echo Users added

  echo .

  echo Customize the script to add the user

  pause

Start_Trac.bat – Start/Stop Trac: In this installation type, we have installed Trac Create a batch file with the following content:

  @echo off

  echo Start Tracd  echo .

  echo Kill the window to close Trac

python C:\Python24\Scripts\tracd --port 8000 --auth trac,C:\MyProject\users.htdigest,trac c:\trac

pause

To exit Trac, close the command window.

Note: You will need to unblock the port 8000 in the Windows XP SP2 Firewall.

Connect to Trac:
Once Tracd is started, you can connect to it by typing the following URL in your Browser:
http://localhost:8000/trac

Note: you can replace localhost with the computer name to access the trac web interface from other computers.

3.3. Assigned to

Per default, the assign to field of the new ticket page is a text box. If you want to restrict this field to already-known users in a drop-down list, you will have to modify the file c:\trac\conf\trac.ini as follow:

  [ticket]

  restrict_owner=true

Note: Only users that have set their email address will be listed

3.4. Static content

The daemon Tracd can serve static content. Just copy your files in C:\Trac\htdocs, they will be immediatly available under http://localhost:8000/trac/chrome/site

4. Expanding Trac

Due to its minimalistic approach, Trac has been integrated in other tools, and plugins have been developped to expand its core functionnalities.

  • TracHacks is listing a large number of plugins for Trac

4.1. Python Egg Package

Note that some Hacks are developped in the form of Python eggs packages (more information).

It means that you will need the programm easy_install to install them. Easy Install is designed to download, install and configure automatically python packages.

To install easy_install on your system, you have to download and install Setup_Tools (md5=ccf2b51e22bad715b6a60c80872bcbee).

Then, to create the egg package, go in the package directory (you will have perhaps to unzip it before) and run the command python setup.py bdist_egg (detailled infos)
Then in the sub-directory dist, you will find the egg file that you can install with the command easy_install [Package]. Easy_install will download all the necessary dependencies.

Note: The PATH Environment variable must contain the directory C:\Python24\Scripts.

4.2. Install Web Admin Plugin

The Webadmin plug is really useful as it will integrate itsself in the trac web interface.
Note that since the version 0.11 this plugin will no more be necessary, it will be included in the core package.

You can download the plugin as a Egg package and install it with the Easy_Install Programm (see above).

A user with full administration rights will be necessary.
Run the command python C:\Python24\Scripts\trac-admin C:\trac permission add lolo TRAC_ADMIN to give administrator rights to the user lolo.

  • Update your trac.ini with the following:
      [components]
    
      webadmin.* = enabled

If everything is working well, you should see a new navigation menu Admin

4.3. Install the Screenshots plugins

Especially if you write documentation, you will be interested in having a ready-to-use collections of screenshots.
The Screenshot Plugin can be used for this task.

  • First of all, download the Screenshots package and its dependency Trac Tags
  • Extract the two zip-packages in a temporary directory (e.g. C:\Temp)
  • Install Tags and screenshot packages as other egg package (python setup.py bdist_egg and then in sub-directory dist easy_install [Package])
  • Download and Install ImageMagick, a library to manipulate images.
  • Update your trac.ini with the following:
      [trac]
    
      default_handler = TagsWikiModule  [components]
    
      trac.wiki.web_ui.wikimodule = disabled
    
      tractags.* = enabled
    
      tracscreenshots.init.screenshotsinit = enabled
    
      tracscreenshots.core.screenshotscore = enabled
    
      tracscreenshots.api.screenshotsapi = enabled
    
      tracscreenshots.wiki.screenshotswiki = enabled
    
      tracscreenshots.tags.screenshotstags = enabled
    
    [screenshots]
    
      title = Screenshots
    
      path = C:\screenshots
    
      component = <component_name>
    
      version = <version_name>
    
      show_name = true
  • Give permission to the users
  • trac-admin permission add lolo SCREENSHOTS_ADMIN will permit the user lolo to add and view the screenshots
  • trac-admin permission add lolo SCREENSHOTS_VIEW will permit the user lolo to view the screenshots
  • Upgrade the Trac database with the command python C:\Python24\Scripts\trac-admin C:\trac upgrade
  • Restart the web server

If everything is working well, you should see a new navigation menu Screenshots

In the wiki, you can reference a Screenshot with the Macro

  [screenshot:1]

  [screenshot:1 screenshot]

4.4. Add links

At the moment, I don’t have found any easy possibility to add a navigation menu to Trac (as will do the plugins)

According to this [page ], here is how you can add links to every HTML page of Trac
Add the following content in the file C:\Trac\templates\site_header.cs

  <div class='nav' style='float:right'>

  <ul>

    <li class='first'><a href="<?cs var:$trac.href.report ?>/1" accesskey="a"><u>A</u>ctive Tickets</a></li>

    <li class='last'><a href="/projects" accesskey="l">Project <u>L</u>ist</a></li>

  </ul>

  </div>

Leave a comment

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