welcome to my blog
The best place on the internet for random code!
www.therealgromer.com









Nov
15
    
Running Subversion on a Windows 2003 Server
Posted (Mike) on 15-11-2007

Recently I had to reinstall 2003 on my server at home, which was home to my BG Alert SVN server. I vaguely remembered setting SVN up about a year ago, so I had to put my trust into Google. Unfortunately, there wasn’t one site that helped with the whole setup. Since I don’t want you to have to deal with that, I’ve put all the information here, in one post.

To get started, you will need to download subversion, the current version is 1.4.5. Make sure you select the setup.exe to download for the newest version as well.

Once you’ve downloaded and installed subversion on the server, create a directory for your repositories. This can be done in Windows Explorer or from the command prompts with the mkdir command (mkdir C:\repositories). You will also need to give the NT AUTHORITY\NetworkService account appropriate rights to the directory you create. If you forget to grant access, you might get denied when trying to commit files to the repository.

After the repository folder is created, you need to create the subversion repository. You will do this in the command prompt:

  1. svnadmin create C:\repository\project

where project is the name of the actual repository you want to create. You can now go to the C:\repository\project folder and you will see a few folders and some files. Go into the conf folder and edit the file passwd. The syntax for adding a user is:

  1. username = password

Save and close the passwd file and open the svnserve.conf file. In here you will want to uncomment:

  1. anon-access = read
  2.  
  3. auth-access = write
  4.  
  5. passwd-db = passwd

You can change the access levels as well while you are in here. I have none for anon-access on mine. The levels are in the comments of the conf file.

After editing the conf and passwd files, you are good to start the server up. The command to start it up is long, so check what you typed in.

  1. sc.exe create SVNService binpath= "C:\Program Files\Subversion\bin\svnserve.exe –service –root C:\repository" displayname= "Subversion Service" depend= tcpip start= auto obj= "NT AUTHORITY\NetworkService"

You might have to change the path to svnserve and to your repository in the binpath argument. Also, not the single space after each equal sign, it is needed. Once the service is installed, you can start it with:

  1. net start SVNService

You can now checkout the repository using something like TortoiseSVN, or any other subversion client you want. The url to the server will be svn://localhost/project, where localhost can also be any ip address or domain and project is the name you gave the repository above. If you are accessing this from outside a firewall, you’ll have to open port 3690 in it to allow access to the subversion server.

If you need any help with this or have questions, leave a comment and I’ll do what I can to help out!

Post a comment
Name: 
Email: 
URL: 
Comments: