Running VisualSVN Server for Subversion Source Control
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:
<Location /svn/> DAV svn SVNListParentPath on SVNParentPath "c:/SvnWestWind/" SVNIndexXSLT "/svnindex.xsl" SVNPathAuthz on AuthName "Subversion Repositories" AuthType Basic AuthBasicProvider file AuthUserFile "c:/SvnWestWind//htpasswd" AuthzSVNAccessFile "c:/SvnWestWind//authz" Satisfy Any Require valid-user </Location>
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
The Voices of Reason
# re: Running VisualSVN Server for Subversion Source Control
I wrote up a post on how to set up VisualSVN Server and TeamCity - basically setting yourself up in big bitchen way for free:
http://blog.wekeroad.com/2008/01/27/source-control-and-continuous-integration-on-the-cheap/
# re: Running VisualSVN Server for Subversion Source Control
Thanks for the hints to TeamCity both to you and Pete. It's something I've been meaning to look into but truth is these projects are solitary for me at the moment (even though I've started putting some stuff on the public site) so it's something on the 'nice to get around to' pile for me. OTOH, you do make it sound so quick and easy you might have just convinced me to do this sooner rather than later.
So where do you run the CI server? On a separate server at the office?
# re: Running VisualSVN Server for Subversion Source Control
http://ankhsvn.open.collab.net/
# re: Running VisualSVN Server for Subversion Source Control
Understood about it being just you - at the same time how often do you run your tests when you check in :). I know you're supposed to but...
# re: Running VisualSVN Server for Subversion Source Control
# re: Running VisualSVN Server for Subversion Source Control
# re: Running VisualSVN Server for Subversion Source Control
The *only* problem is with VisualSVN is it will only install on XP or 2003 (or above), so I have a lovely Windows 2000 machine which it won't install on :(((
# re: Running VisualSVN Server for Subversion Source Control
The only file I found was in the VisualSVN Server/conf folder httpd.conf and it did not seem to affect a new repository after I updated it to include that new line. If possible, I need it to have anonymous access for any repositories we create.
# re: Running VisualSVN Server for Subversion Source Control
http://www.collab.net/downloads/subversion/
I liked this distro better that VisualSVN for reasons that I cant remember now. :)
I also have a blog post detailing detailing how to use the Collabnet installer and how to enable SSL and ActiveDirectory integration:
http://blog.mike-obrien.net/PermaLink,guid,97dbade9-b5ba-44fb-8582-9e8c68cf3e70.aspx
# re: Running VisualSVN Server for Subversion Source Control
If you remember the upsides and downsides of either please do post here. I think that would be useful to all - especially those that are using one or the other only and haven't checked out the other.
# re: Running VisualSVN Server for Subversion Source Control
Just so folks know, there is a bug with Expression Blend not opening when you use VisualSVN. In that in the Solution file, you need to add a "." to the VisualSVNWorkingCopyRoot
GlobalSection(ExtensibilityGlobals) = postSolution
VisualSVNWorkingCopyRoot = .
EndGlobalSection
-
Scott Barnes
Rich Platforms Product Manager
Microsoft.
# re: Running VisualSVN Server for Subversion Source Control
You found this file: C:\Program Files\VisualSVN Server\conf\httpd.conf
But I believe you need to restart the VisualSVNServer service and then allow EVERYONE with read only access.
1. After you edit the file, restart the service for good measure (may not be required).
2. To allow anonymous access at the top level open VisualSVN Server MMC snap in and right click on Repositories. Select properties.
3. Click Add (on the security tab).
4. Select Everyone. Click OK.
5. Change access to Read Only.
6. Click Apply. Click OK.
7. Reload your web page or try to connect to the SVN repository with no user. :D
# re: Running VisualSVN Server for Subversion Source Control
# re: Running VisualSVN Server for Subversion Source Control
<Location /svn/>
Satisfy Any
<Location>
# re: Running VisualSVN Server for Subversion Source Control
http://www.pchenry.com/Home/tabid/36/EntryID/94/Default.aspx
# re: Running VisualSVN Server for Subversion Source Control
# re: Running VisualSVN Server for Subversion Source Control
Best to try this out - could you drop a note here on what you find? I don't have AD set up on my server so I can't really check this out myself.
# re: Running VisualSVN Server for Subversion Source Control
(The issue we have is that all our DB objects, several thousand objects, are stored in SVN and we have an automated deployment script that tries to pull down every artifact. This works fine, expect that it is pinging AD to authenticate for every FILE it looks at. It end up going REALLY slow.)
So we are attempting to set up un-authenticated read-only access as above, but the EVERYONE group is not showing up in the SVN admin when you search. It shows in AD, but not in SVN. Any thourghts as to why it wouldn't be available to choose in SVN?
# re: Running VisualSVN Server for Subversion Source Control
here is the problem: I have a software project in the repository but I don't want that some people access to one or more folders/files. If I set the security on those file everithing is ok. the problem is that, when I create a Branch I have to set again the security rule to access those critical folders/files. how can I do to ensure that access rules are inherited in the branch?
please help me!!
thank you very much!!
Tommaso
# re: Running VisualSVN Server for Subversion Source Control
For that just go to the VisualSVN menu >>Set working copy root... and mark the "Determine working copy root automaticly" and your done.
# re: Running VisualSVN Server for Subversion Source Control
Just a note: after editing the httpd.conf file of the visualSVN, u have to check that the directories are the right ones
# re: Running VisualSVN Server for Subversion Source Control
it work excellent but i have a problem.My ankhSVS just loads the copy of code to our system then synchronize the code on commit and update.Some times i dont want to load the code over the developers systems. i want they work over code , they can edit , update , delete code witt subversion but can not take a copy of code to their system from security issue.
# re: Running VisualSVN Server for Subversion Source Control
http://www.acceptedeclectic.com/2008/05/visualsvn-teamcity-nant-sql-server.html