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.
The software you are going to need is as follows, click the link to download the latest versions.
- xamp devel upgrade (.exe for full upgrade, .zip to get the modules only)
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.
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
AuthName "subversion repository"
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.