Archives for tag: subversion

Installing Subversion on Windows

April 16th, 2007

I’m sure there are many many guides to install Subversion, however I’m going to document the process briefly here for completeness. Installing the actually service is a fairly simple process, download the latest windows package from here. Run this like you would install any other install program. This puts all the necessary executables on your system and sets your path so that you can access these. Now to set up a repository, use the svnadmin create <reponame> This places a folder in with the new database in your current working directory. This is the basic procedure for creating any new repository, unfortunately it is inaccessible by any means other than direct file access.

For network access, there are 2 options, HTTP or Subversion’s own protocol. HTTP is the protocol generally used for the repository’s however, the svn protocol requires much less setting up. In fact, all that is needed to get it up and running is the command svnserve -r -d. This is then accessible across the network with the repository address svn://hostname/pathrelativetotherepodir. Easy!

Setting up the HTTP access is a little more complicated, there is an elaborate howto already written. So I’m just going to rush over it all. First thing’s first, download and install the Apache HTTP Server. Now you must enable the svn modules in apache, this entails copying the mod_authz_svn.so and mod_dav_svn.so modules out of the Subversion install directory and into the Apache modules directory and enabling them in the httpd.conf. This is done by adding

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

to it. While you are at it, add a line including a subversion configuration file to httpd.conf that looks like
Include c:/etc/subversion.conf
This means that any further edits to the httpd.conf regarding subversion can be performed there.

Now to put the finishing touches edit the subversion.conf file you are pointing to and add directives like the following.

<location /project1>
DAV svn
SVNPath C:/Repositories/project1

AuthType Basic
AuthName "Subversion Project1 repository"
AuthUserFile c:/etc/svn-auth-file

Require valid-user

AuthzSVNAccessFile c:/etc/svn-acl
</location>

This will set up the repository at http://localhost/project1 and give it password protected access according to an apache style password file and a subversion acl file.

Normally I would set this up to be controlled with Windows based authentication which isn’t too much of a hassle, you must download the sspi authentication module for apache and enable it in your httpd.conf. with this line
LoadModule sspi_auth_module modules/mod_auth_sspi.so
br/>
then change your subversion.conf file to this…
<location /project1>
DAV svn
SVNPath C:/Repositories/project1

# authentication
AuthName "Subversion Authentication"
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
SSPIDomain DOMAIN
SSPIOfferBasic On
Require valid-user

# authorization
AuthzSVNAccessFile c:/etc/svn-acl
</location>

Bear in mind the DOMAIN should be changed to your windows domain.

Changing the access lists is still exactly the same as it was outlined in the SVN manual however, users should be specified by their full names ie. WAKELESS\michael