Rick Strahl's Weblog  

Wind, waves, code and everything in between...
.NET • C# • Markdown • WPF • All Things Web
Contact   •   Articles   •   Products   •   Support   •   Advertise
Sponsored by:
West Wind WebSurge - Rest Client and Http Load Testing for Windows

Running VisualSVN Server for Subversion Source Control


:P
On this page:

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.

VisualSvnUI

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.

Posted in Software Development  

The Voices of Reason


 

pete w
September 14, 2008

# re: Running VisualSVN Server for Subversion Source Control

Speaking of "dead simple", try hooking that system up to TeamCity for the automated builds. I set one of my clients up with a subversion/teamcity system that cost them $0 that rivals team foundation server any day :)

http://www.acceptedeclectic.com/2008/05/visualsvn-teamcity-nant-sql-server.html

Rob Conery
September 14, 2008

# re: Running VisualSVN Server for Subversion Source Control

Nice post Rick! Is it my imagination or have your posts "mellowed" a bit since you've been back in Maui??? No trades recently though... good for barbecues!

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/

Rick Strahl
September 14, 2008

# re: Running VisualSVN Server for Subversion Source Control

@Rob - Mellowed? Nah - just holding it in <g>... but no doubt life back on the island is a lot slower. It takes me a bit to hit my full stride again after coming back.

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?

Amre Ellafi
September 14, 2008

# re: Running VisualSVN Server for Subversion Source Control

Cool ! just add AnkhSVN to visual studio and rock your world ;)
http://ankhsvn.open.collab.net/

Rob Conery
September 14, 2008

# re: Running VisualSVN Server for Subversion Source Control

I put my code at Google code, and have my CI server on my main server box. It will pull from the repo and build it - which is nice :).

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...

Kent Merrell
September 14, 2008

# re: Running VisualSVN Server for Subversion Source Control

Dang! I wish I were in Maui! Do you do any kite boarding?

Peter Bromberg
September 17, 2008

# re: Running VisualSVN Server for Subversion Source Control

We are now using VisualSvn Server (Windows) and the latest AnkhSvn Visual Studio plugin for our "stuff" and so far, everyting has worked out great. I've tried the VisualSvn client, but at present it looks like the latest version of Ankh is performing well. And I notice that Codeplex.com has just plugged in TortoiseSvn support with no funky "bridge" junk to install.

Milo
September 18, 2008

# re: Running VisualSVN Server for Subversion Source Control

I dropped Ankh, just didn't give me the confidence I needed in an SVN client.

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 :(((

Brian Boatright
September 19, 2008

# re: Running VisualSVN Server for Subversion Source Control

Where is the virtual directory configuration file you updated to have the "Satisfy Any" line?

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.

mob
September 19, 2008

# re: Running VisualSVN Server for Subversion Source Control

CollabNet has a nice Svn/Apache installer here:

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

Rick Strahl
September 19, 2008

# re: Running VisualSVN Server for Subversion Source Control

@mob - I didn't try the collabnet installer, but saw it. Given that VisualSvnServer works fairly well and easy i never got to the point of trying an alternative.

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.

Scott Barnes
September 22, 2008

# re: Running VisualSVN Server for Subversion Source Control

I use VisualSVN as well for Silverlight projects etc.

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.

Robz
October 04, 2008

# re: Running VisualSVN Server for Subversion Source Control

@Brian Boatright:

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

Robz
October 04, 2008

# re: Running VisualSVN Server for Subversion Source Control

Pretty pictures and exact directions for the above can be found here: http://ferventcoder.com/archive/2008/10/04/enhancing-visual-svn-to-allow-anonymous-access.aspx

Ivan Zhakov
November 18, 2008

# re: Running VisualSVN Server for Subversion Source Control

Good practice use httpd-custom.conf to customize VisualSVN Server, because it will not be overwritten on upgrade/reinstall. Just add something like this:
<Location /svn/>
Satisfy Any
<Location>

PHenry
February 20, 2009

# re: Running VisualSVN Server for Subversion Source Control

Thank you very much for the posting, golden! I even created a blog entry on my blog with some additional details. Thanks again!

http://www.pchenry.com/Home/tabid/36/EntryID/94/Default.aspx

Brendan Lawlor
February 23, 2009

# re: Running VisualSVN Server for Subversion Source Control

Would I be correct in saying that this solution will not work if VisualSVN Server is using Active Directory for authentication? There's no 'Everybody' in that case.

Rick Strahl
February 23, 2009

# re: Running VisualSVN Server for Subversion Source Control

@Brendan - not sure. I haven't tried running with AD security. It's still running through Apache so anonymous auth may still apply before the authentication module kicks in, but I'm not sure.

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.

Curt
February 26, 2009

# re: Running VisualSVN Server for Subversion Source Control

Brendan, we have VisualSVN with Active Directory integration.

(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?

tommaso
June 17, 2009

# re: Running VisualSVN Server for Subversion Source Control

hi guys, I really need your help.

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

Ruchit Patel
August 21, 2009

# re: Running VisualSVN Server for Subversion Source Control

Its bug with VisualSVN. Solution's is not opening in Microsoft Expression Blend after using visualSVN.
For that just go to the VisualSVN menu >>Set working copy root... and mark the "Determine working copy root automaticly" and your done.

Alberto
December 11, 2009

# re: Running VisualSVN Server for Subversion Source Control

Thanks! I worked perfectly for me.
Just a note: after editing the httpd.conf file of the visualSVN, u have to check that the directories are the right ones

Ajay
November 21, 2010

# re: Running VisualSVN Server for Subversion Source Control

Hi guys. i am using visualSVN and ankhSVN for team work.

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.

West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2024