installing subversion at home

We have been using subversion at work for a while now and it is a great way to keep track of developments on a project. So this weekend i decided install it myself for use on my personal projects at home. This post is a quick step by step guide to installing it yourself at home on your windows based pc. ( I am going to assume your familiar with subversion and know the basics, if not there are lots of beginner guides on google that will offer more help.

Required Software

The software you are going to need is as follows, click the link to download the latest versions.

Installation

First step is installation. There is no right or wrong way to install the software as once configured everything will be fine, so if you wish just double click everything and install into their default locations. I did things like this….

1) install xampp, there are no complicated options so just follow the prompts to install everything
2) double click on the devel executable to update xampp with the developer extras, if you don’t want all the extra features the developer upgrade offers, you can just copy the two apache modules we require into your xampp folder. The two modules are called mod_dav_svn.so and mod_authz_svn.so and the folder to copy them into is D:\xampp\apache\modules
3) install subversion, again no complicated options just next next next…
4) finally install tortoiseSVN.

Configuration

Once everything is installed we can start to configure things.
First fire up xampp to check everything was installed ok and you can browse localhost and connect to a mysql database (no point continuing if xampp isn’t working at this point).

When you installed subversion it will have asked you for a location to store your repositories , browse to this folder and add a new folder for your project, I deleted the repo folders already in this location as i will have a new sub folder for each project i add e.g D:\xampp\Subversion_repos\project1

Next stop Apache via the xampp control panel (if its still running) and browse to the apache config folder ( e.g. D:\xampp\apache\conf ) open httpd.conf and do a quick search for ‘svn’, uncomment the two LoadModule lines to include the svn modules when apache is started. It should then look like this;
### SVN from XAMPP devel package ###
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

Scroll down to the bottom of the file and add the following…
# Configure Subversion repository
<Location /svn>
DAV svn
SVNPath "D:\xampp\Subversion_repos\project_name"
AuthType Basic
AuthName "subversion repository"
AuthUserFile "D:\xampp\Subversion_repos\passwd"
Require valid-user
</Location>

NOTE: update the file paths to match your installation, you don’t have to add an auth file but if you dont no name will be added to commit notes and anyone will be able to update your code.

Save and close the config file and restart apache to check you haven’t broken it. If apache wont start, browse to the apache\bin folder via command prompt and try running apache.exe manually, any errors will be output to the screen.

while in the \bin folder we can create our password file, use the following command
htpasswd.exe" -c D:\xampp\Subversion_repos\passwords gavin
obviously replace gavin with your username and the file location to whatever you want

Your repo should now be setup and configured. Test it by browsing to the virtual folder you setup e.g. http://127.0.0.1/svn/project_name , you should be prompted for your username and password and then see a page with revision 0 on it, alternatively you can use the repo browser on tortoiseSVN.

All thats left to do now is checkout a folder and start using version control.

Tags: , , , , , ,

Enough of me, let me know your thoughts below...

  1. Michael Kanartchev Michael Kanartchev says:

    I like your approach. Short and clear.

  2. Gavin Gavin says:

    Hi John,

    Glad you found the instructions useful

    Thankyou for pointing out the error with the code example…
    I must have pasted the code into the <html> view in the editor so WP has stripped the tags. Have updated the article.

  3. Now I see the problem. WordPress is stripping out the tag. For future people that find this post. The configuration needs to be encapsulated in a Location tag. Click on the site link in my previous comment to see the syntax.

  4. Thanks for the instructions. They were VERY helpful. I did have one problem with my setup using xampp 1.7.3 install. I was getting a syntax error and a message:

    Syntax error on line 515 of C:/xampp/apache/conf/httpd.conf:
    DAV not allowed here

    I had to put tags around the httpd.conf settings:

    # Configure Subversion repository

    DAV svn
    SVNPath “c:\xampp\Subversion_repos\project_name”
    AuthType Basic
    AuthName “subversion repository”
    AuthUserFile “c:\xampp\Subversion_repos\passwd”
    Require valid-user

    * Apache 2.2.14 (IPv6 enabled) + OpenSSL 0.9.8l
    * MySQL 5.1.41 + PBXT engine
    * PHP 5.3.1
    * phpMyAdmin 3.2.4
    * Perl 5.10.1
    * FileZilla FTP Server 0.9.33
    * Mercury Mail Transport System 4.72

    This site was helpful in figuring it out.
    http://ajopaul.com/2006/12/11/setting-up-a-svn-14-server-using-apache-22-on-ubuntu/