Image Ulrich Habel
About me/Impressum

search

Google


Search WWW
Search rhaen daily

archives

feeds

Perl nation banner logo thing
14.06.2009

Running a Subversion Server on Win32

Due to some circumstances I had to switch parts of my daily work machines to Windows. Guess what, everyone is still complaining about Windows, however I started to like it. Best part: try to set fonts for the system! It's consistent everywhere - try that with GNOME and start a KDE application. Oooops - did I start the bashing. Sorry for that. Anyway, I had to look for some methods to get a Subversion server running on Win32. Apache with the svn module is one option, however, svnserve might be another option. Here are the steps required:

Install the binaries of Subversion:
Easy - mine had been installed in C:\Programme\Subversion\bin. The path had already been added to the system path.

Setup a blank repository:
Still easy. I've setup mine in C:\Powerplant\code-repository\svn-repo. In order to accomplish this the following commandlines are needed:

svnadmin create C:\Powerplant\code-repository\svn-repo

Edit the configuration:
In order to run a Subversion server you have to edit two config files. They are located inside C:\Powerplant\code-repository\svn-repo\conf. Their names are svnserve.conf and passwd. Let's have a look at the svnserve.conf file first. You need to enable three options inside the file. They are already in there, seek them and remove the hash in front of them. Save the file afterwards.
[general]
...
anon-access = none
auth-access = write
...
password-db = passwd
You should also look inside the sasl thing. All the binaries of Subversion I found had sasl compiled it. It's general a good thing to encrypt your stuff so have a look how to enable it. However it's not necessary to get the server running.
Second will be the passwd file. Here are all the passwords for the user stored. The syntax is simple.
username = password
In this example the user with the name "username" and with the secret "password" is able to log in.

Start the daemon:
Here are two ways to manage this. Running the daemon inside a command box with the subcommand --daemon will work for some cases if you are not allowed to work inside the Win registry (like it will be at my workplace). Use a small batch file inside your autostart group for it.
svnserve --daemon -r C:\Powerplant\code-repository\svn-repo
Another way might be to enable the svnserve as Windows service. The commandline looks quite strange but I promise it will work this way. The syntax is in key= value style. Please note: there is a space before the value. If you don't do it that way the command will fail. If you'd used spaces inside your paths make sure to quote them. Quoting in general a good thing, I will include this inside my commandline here. Also please note - all the command has to be on one line!
C:\>sc create svnserve binPath= "C:\Programme\Subversion\bin\svnserve.exe 
    --service --root C:\Powerplant\code-repository\svn-repos"
    DisplayName= "Subversion Server"
    depend= tcpip start= auto
Link to the documentation: Here is the full documentation for this: Windows Service Support for svnserve

[/Misc] [link]

powered by NetBSD