Tuesday, January 23, 2007

Setup Subversion 1.4 on Windows 2003

I have been going through the web for the steps to install SVN on Windows server. I tried the Svn1Click but I think it is obsolete now. Well anyway to those who needs it, here are the latest guide on how to setup Subversion 1.4.2 on Windows 2003 server as Windows service.

1. Download and install the latest Subversion. The latest package is 1.4.2 as of today.

2. Create your root folder for your project repository. I created mine at D:\svn_repository.

3. Test out if everything is okay. Fire up cmd (Command prompt) and execute this command, "svnserve -d -r d:\svn_repository". You can find out more of the svnserve options here.

4. That is to start up the SVn light weight server in daemon mode. Now lets see if svn client can connect to it. Execute this "svn ls svn:\\localhost". No news is good news here as we don't have anything in the repository yet.

5. Next lets install SVN as Windows service. Now if you google for this topic, you are going to find some old stuff. I believe the latest and correct way to install SVn as Windows service is by using SC.exe. Well you can get the details of this here.

Execute this command:
sc create "SVNservice" binPath= "\"C:\Program Files\Subversion\bin\svnserve.exe\" --service --root \"d:\svn_repository\"" DisplayName= "Subversion" depend= tcpip start= auto

Assuming that you install Suversion and never mess with the default program path, then you can copy, paste and run the above command.

Note that the space " " between the binPath= and the parameter. The name value pair must be separated by a space. I wasted about half and hour wondering why it won't run.

6. If all goes well, you will see "[SC] CreateService SUCCESS". Yay. Now lets open up the Services tool window and you should see "Subversion" listed as on of the services.

No comments: