Installing Trac on Ubuntu 8.04 with an existing SVN -Part 1

This blog entry gives step by step instruction to the installation of Trac on Ubuntu 8.04 with an existing SVN repository.

Part1: setup trac and svn through Apache
  1. Open a terminal or ssh into the machine or vm you want to install trac
    • ssh kusvdoxx@74.50.49.9

  2. Install apache2 (if apache is installed before, this will just update apache to the newest version), install python, python-setuptools (for easy_install)
    • sudo apt-get install apache2 libapache2 mod-python libapache2-svn python-setuptools python-subversion
  3. You can use sudo apt-get install Trac to install trac, however it willn't install the newest version
  4. Make a directory for trac
    • sudo mdir /trac
  5. Now make a new configuration file for Apache (When apache starts, it will look for this file for configuration):
    • create a new configuration file under /etc/apache2/sites-available and name it 'Trac'
      • sudo vim /etc/apache2/sites-available/Trac
    • Paste the following content:

      • ServerAdmin your@email.com // put your email address here
        DocumentRoot /var/www/

        Options FollowSymLinks
        AllowOverride None


        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all

        ErrorLog /var/log/apache2/error.log
        LogLevel warn
        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

        // the following block can be commented out, because we set the svn config in
        // /etc/apache2/mods-available/dav_svn.conf
        #
        #DAV svn
        #SVNParentPath /svn
        #AuthType Basic
        #AuthName "Subversion Repository"
        #AuthUserFile /etc/svnauth
        #Require valid-user
        #


        SetHandler mod_python
        PythonHandler trac.web.modpython_frontend
        PythonOption TracEnvParentDir /trac
        PythonOption TracUriRoot /trac
        AuthType Basic
        AuthName "Trac"
        AuthUserFile /etc/subversion/passwd // points to svn authentication file,
        // in this way all the svn users
        // can access trac too
        Require valid-user

  6. Disable the default apache config file:
    • sudo a2dissite default // the default apache config file is under /etc/apache2/mods-available/
  7. Enable the new (Trac) apache config file:
    • sudo a2ensite Trac
  8. Restart Apache:
    • sudo /etc/init.d/apache2 restart
  9. Edit trac.ini (/etc/trac.ini will store the default configuration for each Trac project instance)

Recent blog posts