User Tools

Site Tools


This is an old revision of the document!

Project Management

  • Subversion - centralized version control for programming projects)
  • Trac - web-based code viewer, bug tracker, and ticketing system
  • Redmine - web-based code viewer, bug tracker, and ticketing system


Subversion (SVN) uses a centralized model to manage software projects. Collaborators check the source code out from the repository to their local development environments, make changes, then check code back in.

The repository can be on the local machine or a remote server, as SVN supports several protocols (svn://, http:// using Apache's mod_dav_svn module, file://, etc)..


$ sudo aptitude install subversion

Configure Apache:

Create a New Project

On The Server

Create the project skeleton (the name isn't important, it is only a folder in the file system):

$ sudo mkdir /tmp/myproject
$ sudo mkdir /tmp/myproject/{branches,tags,trunk}

Create the SVN repository, :

$ sudo mkdir /mnt/repositories/myproject
$ sudo svnadmin create /mnt/repositories/myproject

Import the initial project skeleton:

$ svn import /tmp/myproject/ file:///mnt/repositories/myproject/ -m "Initial import of project skeleton"

Clean up temp files and repository permissions. The repository needs www-data permissions because Apache will be serving our repository for us:

$ sudo rm -rf /tmp/myproject
$ sudo find /mnt/repositories/myproject/ -type f -exec chmod 660 {} \;
$ sudo find /mnt/repositories/myproject/ -type d -exec chmod 2770 {} \;
$ sudo chown -R root.www-data /mnt/repositories/myproject/

Tell Apache to use /svn/myproject URLs with the dav_svn module, /etc/apache2/conf.d/svn.conf:

<Location /svn/myproject>
    DAV svn 
    SVNPath /mnt/repositories/myproject
    AuthzSVNAccessFile /mnt/repositories/authz_svn_access

    AuthName "Microsoft Active Directory Authentication"
    AuthType Basic

    PerlAuthenHandler Apache2::AuthenMSAD
    PerlSetVar MSADDomain
    PerlSetVar MSADServer

    # require any valid AD user to access the repo via Apache,
    # then use fine-grained controls in the AuthzSVNAccessFile
    # above. See:
    require valid-user

    # Or, use specific (but dumb) controls here in the Apache
    # config file instead of the AuthzSVNAccessFile above.
    #require user aorth akihara

Gracefully restart Apache to enable the changes:

$ sudo apache2ctl graceful

On The Client

Check out the development branch ("trunk") to a local folder ("myproject"):

$ cd code/
$ svn co --username=aorth myproject

Import your existing code base ("mycode") into the project:

$ cd myproject
$ cp -R /home/aorth/mycode/* .
$ svn add *
$ svn commit -m "Initial import of codebase"

Ignoring Files and Folders

Sometimes you need to ignore certain files/folders (logs, temp files, etc) so that SVN doesn't try to commit those changes when it finds new files. For example: ignore everything in our project's tmp folder:

$ svn propedit svn:ignore tmp/

And then place a single "*" in the text editor to ignore everything in the tmp folder. Otherwise, you can do something like "*.log" to ignore all log files.

Tagging Releases

From trunk

$ cd myproject/
$ svn copy .

Switch a working copy to a certain release:

$ svn sw


Create a new Trac project:

$ sudo trac-admin /var/lib/trac/myproject initenv

Change the permissions so the Apache user can manage the Trac environment:

$ sudo chown -R www-data:www-data /var/lib/trac/myproject

Configure Apache to use Python for '/trac' URLs. Put settings in a new configuration file, /etc/apache2/conf.d/trac.conf:

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

The TracEnvParentDir option tells it to allow access to all Trac instances in the specified directory.

Add Active Directory support for login URLs:

<Location /trac/myproject/login>
   AuthName "Microsoft Active Directory Authentication"
   AuthType Basic
   PerlAuthenHandler Apache2::AuthenMSAD
   PerlSetVar MSADDomain
   PerlSetVar MSADServer
   #require valid-user
   require user aorth akihara jmagochi

This will tie Active Directory authentication into the login system for Trac. We use the same scheme for SVN too, so users will be able to log in as the same user they are submitting code as.

Add a user as an admin in a particular Trac project:

$ sudo trac-admin /var/lib/trac/myproject permission add aorth TRAC_ADMIN

Resync Trac/SVN

If your Trac gets out of sync with your SVN repository you will have to resync them:

$ sudo trac-admin /var/lib/trac/myproject resync
Resyncing repository history... 
1 revision cached.


project_management.1276085255.txt.gz · Last modified: 2010/06/09 12:07 by