Subversion

From GridSiteWiki

Subversion is a version management system similar to CVS. Unlike CVS, Subversion can use the WebDAV protocol and an Apache module, which the svn command-line tools can communicate with directly. This means one less service to run if you're already running a web server, and due to the modular design of Apache, it can be used with GridSite-based authorization.

This guide describes setting up Subversion, GridSite and Apache, using the GridSiteACLPath directive introduced in GridSite 1.3.4.

You should follow the basic independent installation and configuration steps for the three components. For RedHat derived systems, the Subversion website provides binary RPMs for recent releases. You must include the WebDAV and Subversion modules to the Apache configuration file:

LoadModule dav_module     modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so

and you should check that Subversion is working with anonymous or password protected requests using the svn client.

We will assume you're only going to use Subversion over HTTPS rather than HTTP. In the HTTPS virtual server, include the SSLUserName directive to fill the HTTP user with the client's certificate DN. (This is used by Subversion for recording and displaying who made each commit to the repository.)

SSLUserName             SSL_CLIENT_S_DN

For production use, you should create a directory which is writeable by your webserver Unix account (for example, apache) and which can contain multiple repositories. Each repository will be a separate authorization domain, with its own set of users able to read or write within it. It should be outside of the DocumentRoot (eg /var/www/html) exported by Apache. For example, use /var/www/svn

Now add a Location section to define the virtual URL space owned by the Subversion Apache module:

<Location /svn>
# make sure GridSite doesnt try to fulfill any of the DAV methods
 GridSiteMethods
# work out GACL path from REQUEST_URI
 GridSiteACLPath /var/www/html/svngacls/%2.gacl
# turn on SVN mod_dav
 DAV svn
# point to the repositories
 SVNParentPath /var/www/svn
</Location>

These four directives make sure that GridSite doesn't try to fulfill the PUT, MOVE etc methods used by WebDAV for these virtual URLs; tell GridSite what GACL files to use for the virtual URL space; turn on mod_dav in Subversion mode; tell mod_dav_svn where to find the repositories.

Both SVNParentPath and GridSiteACLPath work out which GACL or repository to use based on the URL given. The %2 in GridSiteACLPath refers to the 2nd part of the request's URI on the server. For example, main-project in https://www.gridsite.org/svn/main-project/Makefile In this example, %0 would refer to the 0th component, or www.gridsite.org

This virtualisation allows additional repositories to be added without having to modify the Apache configuration and restart.