DevOps Monkey Goodness

Install Subversion On Windows Server 2003

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.

2 Comments

  1. Ivan Zhakov Ivan Zhakov
    12th July 2009    

    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.

  2. John Bowers John Bowers
    22nd July 2009    

    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.

Leave a Reply