Setting up a Subversion server (using svnserve)
Posted by Sebastien Lachance on November 29, 2007
I got hold of an old computer that I will be able to use as a continuous integration server and Subversion repository. This weekend, I got some free time and decided to set-up Subversion on it. I was surprised on how much it was easy. The documentation is all but superfluous and it was very instructive. So here is how you can do it.
Downloading and installing subversion
You can find the latest version here. I used the svn-1.4.5-setup.exe one. Just install it like any other program, there is no additional things to modify in the setup.
Setting up a repository
You may want to create a repository right now to make sure that you can make some test later. I recommend using TortoiseSVN for that, unless you want to learn all the command to use Subversion (not so hard to do). To do that, you simply need to create a folder that you want as a repository (this folder will hold all your files and every change made to them), and right click on it. Select the TortoiseSVN\Create repository here menu items and select the Native File System (FSFS) radio button. You now have fully working repository. For a comparison of Native File System versus Berkeley Database, take a look at this link.
svnserve
You then have two choices to use Subversion remotely. First one is to use the Apache HTTP server and the second one is to use svnserve. I have decided to use svnserve because it’s a lightweight server program and I don’t need encryption and logging. Also svnserve is a lot faster and it’s the best options for small teams. You may want to make sure you are able to access it. Open a command prompt and type svnserve. You should see the following :
If you still planning to use svnserve right now, you have two choices : install it as a service or open it each time you want to access a repository.
If you are planning to open it each time you want to access your repository, launch a command prompt and type svnserve -d. You have access to all the repositories you may have created on the server.
If, however, you decide to use it as a Windows Service (it will reopen automatically each time you start the server), Use this at a command prompt :
C:\> sc create svn binpath= “\”C:\program files\svn\bin\svnserve.exe\” –service -r C:\nameofyourrepository” displayname= “Subversion Server” depend= Tcpip start= auto
Controlling access
If you attempted to use this right now to make a check-in, you will find that you don’t have Write access. This can be changed by editing the svnserve.conf found in your repository folder. You need to find the # anon-access = read and change it to anon-access = write (don’t forget to remove #). This will grant write access to all anonymous users. This is not the ideal, but in a single programmer scenario it works perfectly. However, note that if you need a more robust authentication solution, it’s totally possible. I will not cover it right now, but the full procedure is described in the TortoiseSVN documentation (Section 3.2.4).
Accessing the repository remotely
Open the repository browser (shown below) and type svn://nameofyourserver/nameofyourrepository. Can it be more easy?




