TMG 2010 – Export Some, Not All
February 16, 2011
Making the most of University
March 28, 2011
Show all

Subversion, Trac, Apache & mod_dav_svn

I had looked at this a while ago but gave up thinking it was too hard, too time consuming. It still is.

To begin with, Subversion, or SVN, is a version control system, typical used by programmers and the like. I have previously used it professionally, and came to the conclusion that I needed to start documenting a website I look after and make changes to pretty often.

I started out installing Subversion:

yum install subversion

This installed the “latest” RPMForge version of Subversion (1.6.12).

To run an SVN repo through Apache, you need to install mod_dav_svn, an Apache module that essentially runs an SVN WebDAV connector. This allows you to reference the SVN repo in your SVN client using http://hostname/svn/reponame – if you configure it like that. This is seemingly easier than configuring SSH+SVN access, in that you don’t have to configure user accounts etc for each user.

Difficulty in this, especially with CentOS 5, is that the mod_dav_svn package, is only available from the CentOS Plus repo… RPMForge don’t ship a package for this.

This isn’t an issue, right? Wrong. The CentOS plus package is versioned the same as Subversion in the CentOS repo, that being 1.4.2.

Since I installed Subversion 1.6.12 from RPMForge repo, I was unable to install mod_dav_svn as the dependency was not able to be met.

yum remove subversion
yum clean all
yum install subversion mod_dav_svn –disable-repo rpmforge

That’s it.

Now, create repo (my security context is quite possibly wrong, ignore until I fix it)

useradd -G svn apache
mkdir /home/svn
chown svn:svn /home/svn
chmod 770 /home/svn
mkdir /home/svn/reponame1
svnadmin create /home/svn/reponame1

Next, to configure Apache. I created a separate config file, /etc/httpd/conf.d/svn.conf, where I configured the module itself:

--insert code--

From there, I added an SVN alias to one of my vhosts (I use the structure /etc/httpd/conf.d/vhosts/vhostname.tld.conf). The “SVNParentPath” variable points to /home/svn, and the next line allows the web server to produce a directory list for this folder. This will effectively show each of the SVN repo’s under the parent path /home/svn.

--insert code--

All seemed to work well except for a few issues. Permissions need to be modified for the SVN repo, such that the webserver can read it. In my extremely unco security setup, this means I had to give read/write permission to the Apache user. This could be better implemented (the permissions setup I gave earlier in this post are quite possibly better than my original implementation, which didn’t work).


0 0 votes
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x
%d bloggers like this: