Setting up a new Subversion repository and Trac project


Here are the steps I use each time I need to create a new Subversion repository:

Create Repository

> sudo svnadmin create /var/svn/MY_PROJECT_NAME

Create TRAC project

> sudo trac-admin /var/www/trac/MY_PROJECT_NAME initenv

During install, you will be prompted for the repository path created above.

Set up Apache to serve TRAC project

> cd /etc/apache2/sites-enabled
> sudo nano 000-default
# add each repository to apache
# also, we need to let the apache user read the directory:
# (the basic authentication isn't passed on to the user)
> cd /var
> sudo chown -R www-data.svn svn
# (alternative: add www-data to svn group)
# set perms correctly on new trac directory
> cd /var/www
> sudo chown -R www-data.svn trac
# update Apache settings to enable trac authentication; as described here:
# http://trac-server-hostname/trac/MY_PROJECT_NAME/wiki/TracModPython
> cd /etc/apache2/sites-enabled
> sudo nano 000-default
> sudo /etc/init.d/apache2 restart

See the original article that inspired this post.