I've been using Subversion for source control for a couple years now and I'm not looking back to SCC style source control in Visual Studio. I wrote up steps for getting a Subversion repository going last year and in there I talked about setting up Subversion and creating repositories using the built-in TCP/IP based server and configuring the server with TortoiseSVN.
When I moved to my new server about a month ago, I decided that I should also move my Subversion Source Control Repository over to HTTP now finally that I have a box that has a bit more resources to spare. Previously I'd been using the built-in SVN service and that's been working Ok, but I've been meaning to open my work repository to allow linking to code more easily and to allow people easier access to some of the code I've published or talked about in Blog posts.
Since I last did a server install of Subversion things have changed a bit and it looks like you have to pretty much install some third party distro if you don't want to compile the code yourself. One of the distros is VisualSvn Server and since I already use VisualSVN and like it I decided to give it shot.
Installation and configuration is dead simple and the installer pretty much handles setting up Subversion and Apache to enable HTTP access. That's certainly one headache I DIDN'T want to deal with and VisualSVN makes this part dead easy. Apache configuration is not something I'm very familiar with and every time I do I spend a bit of time fixing some minor setting that I just can't seem to find <g>. So VisualSvnServer configures the server for use with Subversion - once you've installed all you have to do is create repositories and off you go and you're ready to serve your Subversion repository over HTTP. The only thing I had to change really was the port since I am already running IIS 7 on the box, so I switched Apache to run on 8080.
VisualSvn Server makes it very easy to create new repositories via the VisualSvn Server MMC console which is quick and easy to use.
With a couple of clicks you can create a new server repository add or edit users and configure access for these users and each repository. Literally it takes only a few minutes to be ready to have a repository up and running from installation to access with TortoiseSvn from client.
It's not real obvious how to 'import' existing repositories and I screwed this up by choosing the Import Repository option which completely hosed my old repository (yes I backed up first <s>) - VisualSVN Server created a nested folder that blew the recursive folder limit. Ouch.Turns out there's a much easier way: Create the root repository and it will ask for a base folder under which each of the repositories are created. Once this base folder exists I was able to just copy my old repository underneath and VisualSVN Server was seeing it fine that way.
You can also add and edit users in the user interface, which is a little easier to do than in the config files especially when setting up the first few user(s).
Anonymous Repository Access
Speaking about authentication and repository access permissions, one thing that took me a while to get though is how to configure anonymous access. By default Visual SVN Server requires users to log in to access the repository, even when the Everyone account is set up with ReadOnly access. Unfortunately VisualSVN Server doesn't appear to provide an option to enable this functionality and it turned out to be a bit frustrating to set up the Everyone account with ReadOnly access and still be prompted for a required username and password. By default the Everyone account still needs to be an authenticated account.
As I mentioned I'm a dork when it comes to Apache configuration, but the fix for this is easy (thanks to Matthieu who commented on a previous post) by using Satisfy Any in the virtual directory configuration:
AuthName "Subversion Repositories"
Using both Satisfy Any (which provide Anonymous access) and Require valid-user which provides for authentication for anything but the Everyone account. Certainly a lot nicer than requiring a Guest user with no password.
This would be a good addition to the Visual SVN Server UI I would think since this is probably a common switch people want to set. Off by default to be sure, but optionally available somewhere.
I like it
Cool! I've been running the HTTP repository which is great and I've been able to link directly to source code from the blog which makes it much easier to post code especially when talking about a bunch of related classes in different modules. Beats the heck out of creating a zip file and uploading separately.
One thing I did notice though is that HTTP seems considerably slower than the TCP/IP connectivity for updates to the repository. I was always amazed at speed of Tortoise and Subversion, but now there's a definite lag between updates even if the connection is not over SSL. I would have expected a slight slowdown, but not so significantly. Not a huge deal - there's not that much code going back and forth for me, but something to consider especially if your main goal is set up a personal repository.
VisualSVN Server is cool. It makes getting a new repository set up on a server a snap - one less thing to configure on the many things that need to get set up on a new server. There are a few rough edges, but they are minor and the core features especially related to set up work well and that's really what counts.
Other Posts you might also like