Wednesday, September 02, 2009

Subversion setup in AD environment

Setting up Subversion in an Windows 2003 Active Directory environment
 
Install the following packages :

subversion-1.4.2-4.el5_3.1
mod_dav_svn-1.4.2-4.el5_3.1

Create the repository

mkdir /var/www/svn
chown -R apache.apache /var/www/svn
cd /var/www/svn
svnadmin create SVN-REPO

Create a file structure for project initializations

[root@isportal svn]# mkdir /opt/svn
[root@isportal svn]# cd /opt/svn
[root@isportal svn]# mkdir {branches,tags,trunks}


Import directory structure to the new project

[root@isportal svn]# svn import /opt/svn/ file:///var/www/svn/SVN-REPO/Project1 -m "Initial import for first project"
Adding /opt/svn/branches
Adding /opt/svn/trunks
Adding /opt/svn/tags

Committed revision 15.


Now the project can be viewed via an SVN client or firefox using http://servername/SVN-REPO/Project1 provided you have the access rights. Access permissions are provided in the /etc/httpd/conf.d/subversion.conf file as follows :


DAV svn
SVNPath /var/www/svn/SVN-REPO
AuthzSVNAccessFile /var/www/svn/accessfile
AuthType Kerberos
AuthName "Kerberos Login"
KrbAuthRealm DOMAIN.TLD
KrbVerifyKDC off
Require valid-user




Setup /etc/krb5.conf for kerberos authentication and define the svn access file as below:

[groups]
IT = user@DOMAIN.TLD, user2@DOMAIN.TLD
QCSWrite = developer@DOMAIN.TLD

[SVN-REPO:/Project1]
@IT = r
@QCSWrite = rw
* =

Here the IT group defined in the first section has read access to all repos, the nameWrite groups have read and write access, all others have no access.


To create any new project, just import the directory structure as shown earlier with the new project name, and added a section in the above accessfile as per the requirements of the application team.