Articles » A (Linux) Server for Software Developers » Setting up and Using a Secure Trac and Subversion Server » Setting up Trac for a Secure Multi-Project Subversion Repository

Setting up Trac for a Secure Multi-Project Subversion Repository

Trac is an effective software development management tool. It allows collaborative documentation creation, bug/feature-request tracking and viewing of source-code revisions. The last feature alone is worth having since it provides an easy user interface to every revision that was committed to the SVN repository. Details on using SVN and Trac are provided here.

The following installation procedure will install Trac for managing multiple projects. All access (including viewing/submitting tickets) are password projected. This is a good configuration for closed-source development in which only the developers are allowed access. 

Automated Installation (ScripTS)

I have put the entire installation process into a bash script. There are two scripts: one installs just Trac and assumes that SVN us already installed as per the instructions on this page. whilst the other installs SVN and Trac to provide a complete version control and management system. The easiest method to install these is to enter the commands provided below into the Linux consolte (terminal); these commands will download and execute the installation script. Please note that these scripts assume that all files are in the same place as a Debian 4.0 installation. Also, these scripts download a few files from this website, so an internet connection is required.

su
<it will prompt for your root (administrator) password>
wget https://hdrlab.org.nz/assets/Articles/TracSVNInstall/devserver-https-install
chmod 766 devserver-https-install
./devserver-https-install

Setting up the Trac Server

This prcedure assumes that SVN is already installed as per this page. This configuration requires passwords for every operation, including . For convenience, it uses the same passwords file as the SVN repository. The following steps are for Debian 4.0 or better (they may work with previous versions, but it has not been tested:

  • Install the following packages: trac libapache2-mod-pythonlibapache2-mod-python-doc. This can be done either via the package manager, or use the console (easier in my opinion). To install these packages via the console (Terminal), enter the following:

su
<it will prompt for your root (administrator) password>
apt-get install trac libapache2-mod-python libapache2-mod-python-doc

  • Enable the mod_python module:
a2enmod mod_python
  •  Make a directory to hold the Trac projects (it must be owned by www-data):
mkdir /home/trac
chown www-data /home/trac
  • Insert the following to /etc/apache2/sites-available/ssl
<Location /projects>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /home/trac
PythonOption TracUriRoot /projects

AuthType Basic
AuthName "My Trac Server"
AuthUserFile /home/svn/.dav_svn.passwd
Require valid-user
</Location>
  • Alternatively, a ready made /etc/apache2/sites-available/ssl file can be downloaded here:
cd /etc/apache2/sites-available
wget http://hdrlab.org.nz/assets/Articles/TracSVNInstall/ssl
  • Time to create Trac project for the new project that was created when SVN was installed:
trac-admin /home/trac/newproject initenv
chown -R www-data /home/trac/newproject
  • Test the Trac site by opening a browser, and entering the URL , e.g., http:mytracserver.com/projects (replace mytracserver.com with the URL of your server). The web browser may warn you that the certificate is certified by an "unknown authority." This "unknown authority" is yourself (it is a self-signed certificate). Permanently accept the certificate. If everything was successful, your web browser should look something like the following:
  • Please note that Trac will display an error for SVN repositories that have no revisions (i.e., no source-files have been imported yet). The first revision can be created by performing an initial import

 





Articles » A (Linux) Server for Software Developers » Setting up and Using a Secure Trac and Subversion Server » Setting up Trac for a Secure Multi-Project Subversion Repository