Install Subversion On Windows Server 2003

6. July 2009 15:54 by Dan in Source Control  //  Tags:   //   Comments (5)

I had a search around for information on installing Subversion on a Windows server and found a few articles but all seemed to be out of date or just didn't work!  So here's another step-by-step guide to installing subversion on a Windows Server (I wrote this as I installed so it should be complete!)

Note: Here I'm documenting installing Subversion 1.6.3 on to a Windows 2003 Server.

Installation and Configuration:

Download the latest binary installer:
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100&expandFolder=8100&folderID=91
(I went for "Setup-Subversion-1.6.3.msi")

  1. Run the installer downloaded above.  By default this will install svn to %programfiles%\Subversion and modify the global path appending the bin directory.
  2. You need to create an additional system variable:
    SVN_EDITOR
    %windir%\notepad.exe
  3. Create a local repository by running the command line, this will create the physical directory and a top level repository in subversion:
    svnadmin create c:\repos
     
  4. Configure Subversion to run as a windows service.  If you don't want to setup Apache then subversion comes with a lightweight server called SvnServe that runs over TCP/IP, according to the docs its good for smaller installations.

    Run from the command line:
      sc create svnserve binpath= "\"C:\Program Files\Subversion\bin\svnserve.exe\" --service --root c:\repos" displayname= "Subversion" depend= tcpip start= auto obj= "NT AUTHORITY\LocalService"

      sc description svnserve "Subversion Server (svnserve)"


      This will create a windows service that runs under the LOCAL SYSTEM, ensure that this user has the appropriate permission to read/write Subversion and the repositories.
  5. Edit c:\repos\conf\svnserve.conf
    anon-access = read
    auth-access = write
    password-db = passwd

  6. Enable the test users by un-commenting the lines in file c:\repos\conf\passwd
    [users]
    harry = harryssecret
    sally = sallyssecret

  7. Start the service (check the eventlog if you have any problems):
    net start subversion


 Create a Test Folder

Now we're up and running lets create a test to make sure everything is working.

  1. Create a sub folder in the top level repository by running the command line :
    svn mkdir svn://localhost/test

  2. Notepad should launch with a test file, edit the first line and close: 
    image
  3. You'll be prompted for a login so enter the user details from the passwd file (sally/sallyssecret)
  4. You should get confirmation of a successful checkin!

 

Accessing Subversion Remotely

If you want to access Subversion remotely by default Subversion uses TCP port 3690 so just open this up on your firewall.

Troubleshooting

  • When starting the Subversion service you receive: "The service did not respond to the start or control request in a timely fashion."
    Ensure that the permissions are set on %programfiles%\Subversion and that the repository directory (c:\repos) exists.

Comments (5) -

Ivan Zhakov
Ivan Zhakov
7/12/2009 10:30:21 PM #

Another way:
1. Download VisualSVN Server from http://www.visualsvn.com/server/download/
2. Install it.
3. Enjoy Subversion server and nice management console for free.

John Bowers
John Bowers
7/22/2009 2:35:07 PM #

Thanks for the info. I was wondering if you might know why I'm having an issue with the sc create program. I call it exactly as shown (except with the path to my repository) and all it does is print the DESCRIPTION/USAGE/OPTIONS info and if I try the sc description command it says there is no svnserve service.

John Bowers
John Bowers
7/22/2009 2:48:33 PM #

Nevermind, sorry about that. I was using parameter=value but sc requires parameter= value (with the space). Thanks so much for the post.

John Bowers
John Bowers
7/22/2009 2:49:12 PM #

BTW clicking on your name in the header image of the site takes me to a 404.

Admin
Admin
7/23/2009 9:18:45 AM #

Thanks John, I'll fix that now!

Pingbacks and trackbacks (1)+

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading