Monday 31 August 2009

How To configure SVN 1.6 on a machine allready running Apache 2.2 under Windows (XP/Server 2003):

I have previously been using VisualSVN or just TorioseSVN in standalone mode but wanted to be able to do other things with Apache on the same machine than just host subversion (VisualSVN limitation) or upgrade TortoiseSVN without worrying about corrupting up my repository (standalone mode)! The following is what worked for me, with some pointers taken from the Subversion install Readme file,the subversion book and a fair bit of head scratching:


2/ this should automatically add 'C:\Program Files\Subversion\bin' to the SYSTEM PATH, check by:

(right click 'my computer' -> properties -> Advanced -> Enviroment Variables -> System Variables -> path)

it should be in there somewhere, if it was the last thing you installed it should be at the end!

3/ open up command prompt (start -> run -> cmd) and at the C:\> prompt type:

svnadmin create c:/Repository/

This will create a new repository in the directory c:\Repository.If you want it in a different location just subsitute 'c:\Repository' for the path you want.

**WARNING** as subverision was developed in Unix/Linux when you type 'svnadmin create' the slashes in the directoty location have to go the wrong way to what you are used to in Windows (treat it like a URL rather than a directory path)!!

4/ Copy 'mod_dav_svn.so' and 'mod_authz_svn.so'

from -> C:\Program Files\Subversion\bin

to -> C:\Program Files\Apache Group\Apache2\modules (or where ever Apache is installed)


5/ Make a backup of and then edit the Apache configuration file and make the following changes: (C:\Program Files\Apache Group\Apache2\conf\httpd.conf)


A. Uncomment the following two lines:
#LoadModule dav_fs_module modules/mod_dav_fs.so

#LoadModule dav_module modules/mod_dav.so


B. Add the following two lines to the end of the LoadModule section:
LoadModule dav_svn_module modules/mod_dav_svn.so

LoadModule authz_svn_module modules/mod_authz_svn.so


C. Add the following to end of the file. Note: This Location directive is a minimal example with no authentication directives. For other options, especially authentication options, see the Subversion INSTALL file, the Subversion Book, or the TortoiseSVN Manual.

DAV svn

SVNPath C:/Repository/ (or where ever you created the repository in step 3)

Note the forward slashes again in the path!

6/ Restart the PC & check that Apache has started properly (if not double check all of the above)

7/ On the machine tha Apache is running on navigate in a web browser to: http://localhost/svn/if everything is setup correctly you should see this picture :


8/ Now to import the directory structure into subversion:

A. create a directory called temp
B. Inside 'temp' create a directory called 'Project' (or whatever you want your project to be called NO SPACES THOUGH!)
C. Inside 'Project' create three directories called 'branches', 'tags' & 'trunk'
D. right click on 'temp' and then from the TortoiseSVN menu(http://tortoisesvn.net/downloads) select import. (you can do all of this from a command prompt but I find TortoiseSVN so easy to use there is not much point!)
E. in the URL enter: http://localhost/svn/ (provided you are doing this on the machine which is running Apache)
F. in the message you can put something like 'creating directory structure to hold project'
G. Then click 'OK'
9/ Subversion is now set-up and ready to use (BUT WITHOUT ANY SECURITY ENABLED!) see subverion book & TortoiseSVN for the rest.



No comments:

Post a Comment