Edgewall Software

Version 25 (modified by anonymous, 20 years ago) ( diff )

This page documents the 1.4 (latest stable) release. Documentation for other releases can be found here.

Trac Installation Guide

The Trac web-based project management tool is implemented as a server side cgi-program. Trac is written in the Python programming language and uses SQLite as an embedded database. For HTML rendering, Trac uses the Clearsilver template system.

Requirements

To install Trac, the following software packages must be installed:

Installing Trac

$ python ./setup.py install

This will byte-compile the python source code and install it in the site-packages directory of your python installation. The directories cgi-bin, templates, htdocs and wiki-default are all copied to $prefix/share/trac/ .

The script will also install the trac-admin command-line tool, used to create and maintain project databases. Trac-admin is the command center of Trac.

Note: you'll need root permissions or equivalent for this step.

For more information on installing Trac on specific platforms, see:

Advanced Users

To install Trac in a different location, and other advanced installation options, run:

$ python ./setup.py --help

Creating a Project Database

Trac stores wiki pages, tickets and all other information in a single embedded SQLite database. SQLite databases are stored as a single ordinary file on your filesystem, no separate database server or environment is required.

A new trac database is created with trac-admin:

$ trac-admin /path/to/mydatabase.db initdb

Note: The database file have to be located in a directory where the web server user has write permission to both the file and the directory.

trac-admin will ask you where your subversion repository is located and where it can find the trac templates directory (the default value should be fine).

Configuring Apache

Copy (or symlink) "trac/cgi-bin/trac.cgi" to you web servers /cgi-bin/ directory. You can also configure apache to use the "trac/cgi-bin/" directory directly if you like, it's a matter of taste.

Finally edit the apache config and add this config snippet, with filenams edited to match your installation:

Alias /trac/ "/usr/share/trac/htdocs/" #or where you installed the trac docs
#You have to allow people to read the files in htdocs
<Directory "/usr/share/trac/htdocs/">
	Options Indexes MultiViews
	AllowOverride None
	Order allow,deny
	Allow from all
</Directory>


# Trac need to know where the database is located
<Location "/cgi-bin/trac.cgi">
	SetEnv TRAC_DB "/somewhere/myproject.db"
</Location>

# You need this to allow users to authenticate
# trac.htpasswd can be created with 
# cmd 'htpasswd -c trac.htpasswd' (UNIX)
# do 'man htpasswd' to see all the options
<Location "/cgi-bin/trac.cgi/login">
	AuthType Basic
	AuthName "trac"
	AuthUserFile /somewhere/trac.htpasswd
	Require valid-user
</location>

Note: When creating a new database, trac-admin will print a config snippet customized for your project.

Using Trac

You should now have a working Trac installation at:

http://<yourhostname>/cgi-bin/trac.cgi

There you should be able to browse your subversion repository, create tickets, view the timeline etc. Keep in mind that anonymous users (not logged in) can only access a restricted subset of all Trac features.

Please continue to TracPermissions to learn how to grant additional privileges to authenticated users.

For further user-documentation, see TracGuide.

Enjoy''


See also: TracGuide, TracPermissions, TracOnNetBsd, TracOnOsx, TracOnMandrakelinux

Note: See TracWiki for help on using the wiki.