from here

If you are wondering why exactly you need version control, then you should probably read this. Subversion is a great open-source version control system. And Trac is a good project management and bug/issue tracking system which works seamlessly with Subversion. The problem is how to create and manage multiple projects using a single build procedure.

Subversion + Trac

The Solution

First we need a machine running Ubuntu. The steps below have been tested for Ubuntu 8.04.

Launch terminal and run the following command to install Apache, Python and Subversion.

1.sudo apt-get install apache2 libapache2-mod-python libapache2-svn python-setuptools subversion python-subversion

You can use sudo apt-get install Trac, but the version it installs is 0.10.4. Inorder to get the latest version of Trac use the following command. I suggest you specify the latest stable version of Trac in the command line. As of writing this guide, it is 0.11.3. Also, execute the commands below i.e. create directories svn and trac; create a htpasswd file with your usernames.

1.sudo easy_install
2.sudo mkdir /svn
3.sudo mkdir /trac
4.sudo htpasswd -cm /etc/svnauth yourusername
5.sudo htpasswd -m /etc/svnauth nextusername

Next you have to create a file for permissions

1.sudo gpedit /etc/svnaccess

Add the following contents to the file. Make sure you change yourusername and nextusername to the usernames you have created.

2.developers = yourusername, nextusername
3.[ / ]
4.@developers = rw
5.* = r

Then you have to create a new configuration file for Apache by executing:

1.sudo gedit /etc/apache2/sites-available/myserver

Add the following contents to the file. Make sure you change to you email address.

01.<VirtualHost *>
03.    ServerAdmin
05.    DocumentRoot /var/www/
06.    <Directory />
07.        Options FollowSymLinks
08.        AllowOverride None
09.    </Directory>
10.    <Directory /var/www/>
11.        Options Indexes FollowSymLinks MultiViews
12.        AllowOverride None
13.        Order allow,deny
14.        allow from all
15.    </Directory>
17.    ErrorLog /var/log/apache2/error.log
18.    LogLevel warn
19.    CustomLog /var/log/apache2/access.log combined
20.    ServerSignature On
22.<Location /svn>
24.   DAV svn
25.   SVNParentPath /svn
27.   AuthType Basic
28.   AuthName "Subversion Repository"
29.   AuthUserFile /etc/svnauth
30.   Require valid-user
32.   AuthzSVNAccessFile /etc/svnaccess
35.<Location /trac>
37.   SetHandler mod_python
38.   PythonHandler trac.web.modpython_frontend
39.   PythonOption TracEnvParentDir /trac
40.   PythonOption TracUriRoot /trac
42.   AuthType Basic
43.   AuthName "Trac"
44.   AuthUserFile /etc/svnauth
45.   Require valid-user

Once that is done, activate your newly created configuration file by using the a2ensite command as follows. Reload Apache, set permissions and edit trac.ini.

1.sudo a2ensite /etc/apache2/sites-available/myserver
2.sudo /etc/init.d/apache2 reload
3.sudo chown -R www-data /trac
4.sudo gpedit /etc/trac.ini

Add the following contents to trac.ini.

2.alt = Logo
3.height = -1 =
5.src = /logo.gif
6.width = -1

/etc/trac.ini will store the default configuration for each Trac project instance. Copy your logo.gif to /var/www folder.

Finally, create a perl file called and add the following contents. Make sure you change yourusername to your username. This step will grant you administration rights so that you can add milestones etc. straight from the web interface.

02.$sName = $ARGV[0];
03.$lName = $ARGV[1];
04.if ($lName eq "") {
05.   $lName = $sName;
07.$sName =~ tr/A-Z/a-z/;
08.$path = "sudo svnadmin create /svn/$sName";
09.system ($path);
10.$path = "sudo chown -R www-data /svn/$sName";
11.system ($path);
12.$path = "sudo trac-admin /trac/$sName initenv '$lName' 'sqlite:db/trac.db' 'svn' '/svn/$sName' --inherit=/etc/trac.ini";
13.system ($path);
14.$path = "sudo chown -R www-data /trac/$sName";
15.system ($path);
16.$path = "sudo trac-admin /trac/$sName permission add yourusername TRAC_ADMIN permission list yourusername";
17.system ($path);
18.print "Done!\n\n";

Once the above file is created, your one click build is ready!

Now every time you want to create a new project, all you have to do is execute: ’shortprojname’ ‘fullprojname’

where shortprojname is the name of your project with no spaces e.g. todoapp
fullprojname is the expanded name of your project e.g. To-Do Application

Create your first sample project and point your browser to http://localhost/trac/shortprojname for Trac
The path for your SVN repository will be http://localhost/svn/shortprojname

If you are looking for a GUI client for Subversion, I suggest you download TortoiseSVN for Windows or Versions for Mac. If you are not sure on how to use TortoiseSVN, here are a couple of tutorials.

Feel free to let me know if there are any suggestions or comments you have. To learn more about Subversion, do take time off to read the Subversion Book.

SHARETHIS.addEntry({ title: “Subversion + Trac for Multiple Projects (One Click Build)”, url: “; });