Difference between revisions of "Trac setup"

From DiLab
Jump to: navigation, search
(Setup)
(Multiple Projects)
 
(6 intermediate revisions by the same user not shown)
Line 4: Line 4:


This was used for Trac 0.11
This was used for Trac 0.11

The easy way, but '''not necessarily the latest stable version''':

sudo apt-get install trac

For the '''latest stable version''' do the following:


Get the dependencies
Get the dependencies
Line 15: Line 21:
sudo sh ./setuptools-0.6c9-py2.5.egg
sudo sh ./setuptools-0.6c9-py2.5.egg


Install the latest Trac (ose only one method from below)
Install the latest Trac (use only one method from below)


sudo easy_install trac
sudo easy_install trac
Line 25: Line 31:
...or download the source and run setup.py:
...or download the source and run setup.py:


wget http://svn.edgewall.org/repos/trac/tags/trac-0.11
wget http://ftp.edgewall.com/pub/trac/Trac-0.11.1.tar.gz
tar -xvvzf Trac-0.11.1.tar.gz
python ./setup.py install
cd Trac-0.11.1
sudo python ./setup.py install




Line 38: Line 46:
Now setup your webserver (apache2 in my case) and restart it.
Now setup your webserver (apache2 in my case) and restart it.
Alternatively you can run tracd for the trac envirionment (see the trac wiki)
Alternatively you can run tracd for the trac envirionment (see the trac wiki)


== Configure ==

Lots of things to configure. Add project picture to the web interface in trac.ini. Add users, setup permissions under the Admin tab. Configure milestones and other parameters. See Trac wiki for more.

=== Assign-to as drop-down list ===

If you want the assign field be replaced wit a list of registered users that have permission to MODIFY_TICKET,
do the following in trac.ini:

...
[ticket]
...
restrict_owner = true
...

More advanced details here: http://pacopablo.com/wiki/pacopablo/blog/set-assign-to-drop-down


== Upgrade ==
== Upgrade ==
Line 53: Line 79:


Now test it!
Now test it!


== Multiple Projects ==

More info: http://trac.edgewall.org/wiki/TracUbuntuMultipleProjects

sudo apt-get install libapache2-mod-python

Set the location for your projects

sudo mkdir /var/lib/trac
sudo chown www-data:www-data /var/lib/trac

Add this in your /etc/apache2/sites-available/... site configuration file for trac

<Location /proj>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/lib/trac
PythonOption TracUriRoot /proj
</Location>

Security - note, you may want to create a separate authentication for each project TRAC.
1. Specify the password file (e.g. use htpassw)
2. Add users in the TRAC Admin portal - add the users and add the permissions to them
3. Verify that trac.ini points to the right password file (keys depend on your authentication method
4. Make sure your Apache site configuration <Location...> has the proper authentication setup, for example:

<Location /trac/myproj>
# authentication scheme
AuthType Basic
AuthName "Trac for myproj"
AuthUserFile /var/lib/trac/myproj/trac_myproj.htpassw
Require valid-user
</Location>

== Notes and Links ==
Nice sites about TRAC, setup and configuration:
* http://robertbasic.com/blog/trac-on-ubuntu/

Latest revision as of 15:35, 21 July 2010

Look at the Trac website for more: TracInstall

Installation

This was used for Trac 0.11

The easy way, but not necessarily the latest stable version:

sudo apt-get install trac

For the latest stable version do the following:

Get the dependencies

sudo apt-get install subversion python sqlite 
sudo apt-get install python-clearsilver python-sqlite python-subversion

Get the "setuptools" and "easy_install" unless you have them already

wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-py2.6.egg
sudo sh ./setuptools-0.6c9-py2.5.egg

Install the latest Trac (use only one method from below)

sudo easy_install trac

...or for a specific version (0.11)

sudo easy_install http://svn.edgewall.org/repos/trac/tags/trac-0.11

...or download the source and run setup.py:

wget http://ftp.edgewall.com/pub/trac/Trac-0.11.1.tar.gz
tar -xvvzf Trac-0.11.1.tar.gz
cd Trac-0.11.1
sudo python ./setup.py install


Setup

First, set up your subversion repository, if any. Then, create a new trac project environment, e.g.

trac-admin /var/lib/trac/projenv initenv

Now setup your webserver (apache2 in my case) and restart it. Alternatively you can run tracd for the trac envirionment (see the trac wiki)


Configure

Lots of things to configure. Add project picture to the web interface in trac.ini. Add users, setup permissions under the Admin tab. Configure milestones and other parameters. See Trac wiki for more.

Assign-to as drop-down list

If you want the assign field be replaced wit a list of registered users that have permission to MODIFY_TICKET, do the following in trac.ini:

...
[ticket]
...
restrict_owner = true
...

More advanced details here: http://pacopablo.com/wiki/pacopablo/blog/set-assign-to-drop-down

Upgrade

You may want to upgrade your earlier trac version tickets and wiki. First, back up the old trac project environment (repository) using

trac-admin /var/lib/trac/projenv hotcopy <backup-directory>

Then remove the previous trac version and install the new version. Finally, upgrade the trac project

trac-admin /path/to/projenv upgrade
trac-admin /path/to/projenv wiki upgrade

Now test it!


Multiple Projects

More info: http://trac.edgewall.org/wiki/TracUbuntuMultipleProjects

sudo apt-get install libapache2-mod-python

Set the location for your projects

sudo mkdir /var/lib/trac
sudo chown www-data:www-data /var/lib/trac

Add this in your /etc/apache2/sites-available/... site configuration file for trac

	<Location /proj> 
		SetHandler mod_python    
		PythonHandler trac.web.modpython_frontend    
		PythonOption TracEnvParentDir /var/lib/trac    
		PythonOption TracUriRoot /proj    
	</Location>

Security - note, you may want to create a separate authentication for each project TRAC. 1. Specify the password file (e.g. use htpassw) 2. Add users in the TRAC Admin portal - add the users and add the permissions to them 3. Verify that trac.ini points to the right password file (keys depend on your authentication method 4. Make sure your Apache site configuration <Location...> has the proper authentication setup, for example:

	<Location /trac/myproj>
		# authentication scheme
		AuthType Basic
		AuthName "Trac for myproj"
		AuthUserFile /var/lib/trac/myproj/trac_myproj.htpassw
		Require valid-user
	</Location>

Notes and Links

Nice sites about TRAC, setup and configuration: