23 May 2006

... is apparently not possible if you're running Apache 2.2. So say my fallen hair and this forum discussion. Unfortunately, that's the version of Apache that the latest XAMPP comes with. (XAMPP is an excellent one-click LAMP++ installer for Windows.)

So what is a poor geek to do?

Well, I first looked at the list of WAMPs (not a gallery of really sexy women, unfortunately) on WikiPedia and decided to download VertrigoServ (which I proceeded to erroneously call "Vertigo Serv" from there on) based on the version of Apache it comes with (2.0.58) -- the last known version in which mod_dav_svn.so works correctly (at least under Windows.) Unfortunately, VertrigoServ is quite a lightweight distribution when compared to XAMPP. I realized only after installing it, for example, that it didn't have PEAR installed. Installing PEAR, fortunately, was not difficult (the instructions at go-pear.org are very easy to follow -- I just ran the script through my browser and it worked a charm.) The real show stopper, however, was that Apache in VertrigoServ isn't compiled with mod_dav.so. Oh boy, back to the drawing board!

Next stop: Apache2Triad! (No, it's not a first-person shooter!)

I was a little apprehensive about downloading the 1.4.4. stable release of Apache2Triad as it contained Apache 2.0.55 not 2.0.58 but I couldn't find any horror stories about SVN not working with 2.0.55 so I proceeded to download it. (And, anyway, I seem to be getting amazing download speeds at the moment on my 8mbit line. I hope this keeps up!)

Aaaarrgh! I didn't notice that 1.4.4 doesn't come with PHP 5! I only found this out the hard way after installing this behemoth and actually getting SVN to work on it. Apache2Triad not only includes the kitchen sink but it appears to have been written by one of those supa-ultra-geeky individuals who also seem hell bent on achieving complete and utter domination over your machine. The darn thing simply oozes character -- all the way to changing the default icon for the folder that it's installed in. (Grrr, leave my folder icons alone!) It also gave an installation error at the very end of the install and then proceeded to give me no choice about rebooting my computer. The actual control panel application didn't work but I could start Apache, MySQL, etc. manually without issue. Listen, Apache2Triad author dude, I love all the effort you must be putting into this and it's lovely that you're giving this away but please respect the fact that the computer your app is being installed on belongs to someone else, not you. Otherwise, what's to separate us from Microsoft?

So, Apache2Triad didn't work for me and I decided to try out WAMP. (At this point I'm wondering whether it would have been faster to snipe a laptop on eBay, have it delivered, install Linux on it and set things up there from source.)

After Apache2Triad, the WAMP installer comes as a breath of fresh air. It even asked me which folder I'd like to use as the DocumentRoot (intelligently defaulting to the www folder.) Oh, I love you WAMP, will you marry me? Umm, actually, no. Been there, done that (not to a one-click installer, but hey!) Let's just remain friends.

Oh how cool, it has a neato tray icon with a menu that shows all installed modules, easy links to the logs, etc. Oh man, this baby is usable! :)

So, after a little fiddling, I've finally gotten everything running under WAMP. By the way, to use SVN with Apache under Windows (so you can browse the repository via your browser, among other things), you just need to follow these simple steps:

  1. Make sure you're running an Apache version smaller than 2.2 (I've tested this to work on Apache versions 2.0.55 and 2.0.58). To save yourself trouble, install WAMP!
  2. Install Subversion using the one-click SVN installer for Windows.
  3. Copy the files mod_dav_svn.so and mod_authz_svn.so to from \Subversion\bin (or your Subversion install folder) to \Apache2\bin
  4. Open httpd.conf (under \Apache2\conf\) in a text editor
  5. In httpd.conf, uncomment (remove the #s) from the following two lines:

    LoadModule dav_module modules/mod_dav.so
    LoadModule dav_fs_module modules/mod_dav_fs.so

  6. In httpd.conf, add the following two lines right under the ones you uncommented:

    LoadModule dav_svn_module modules/mod_dav_svn.so
    LoadModule authz_svn_module modules/mod_authz_svn.so

  7. To set up an alias to the root folder of SVN, add the following to the end of httpd.conf, substituting the location of your SVN repository. [html]
    DAV svn
    SVNParentPath d:\svnrepos
    [/html]

Now you should be able to browse to http://localhost/svn/ to browse a project. Note that this doesn't do any authentication. Look at the SVN docs for how to set that up.

So, in conclusion, WAMP rocks and you should use SVN with Apache 2.2. Whew! :)

Add Your Comment

Spam Protection by WP-SpamFree

Getting SVN working with WebDAV on Windows…

  1. Nice story Aral. I’m half of the time a windows user so i installed apache2, php5, mysql5, etc. on my windows laptop from source, why didn’t you try that? It’s working like a charm!

    You can also try installing cygwin and then build everything from source.

    Fernando
  2. I’m what you’d call a geek of convenience. I don’t mind getting my hands dirty if I need to but I’ll use an easier solution if one already exists. (Of course, in this case, building from source might have actually been the faster route.)

    aral
  3. Too cool man, thanks for this awesome post.

    E
  4. Just a correction to this:

    “Copy the files mod_dav_svn.so and mod_authz_svn.so to from \Subversion\bin (or your Subversion install folder) to \Apache2\bin”

    LoadModule dav_svn_module modules/mod_dav_svn.so
    LoadModule authz_svn_module modules/mod_authz_svn.so

    I had to copy the two files to the “\Apache2\modules” folder and not the “bin” folder there. I think that should help anyone trying to get it working and is a beginner.

    E
  5. The .so’s go in the modules\ directory. You also need to copy the int13_svn.dll and libdb44.dll files, and they do go into the bin directory.

    Marcos
  6. Sh!t, I just spent the last hour trying to get XAMPP 1.5.1′s Apache 2.2 to work with SVN 1.4.0. only to find out that someone on the tigris.org website highlighted in bright yellow that it does not work.

    Instead of installing another all-in-one solution, I think I will just setup 2.0 on another port for the purposes of SVN…..sucks.

    Mark Lapasa
  7. Great post man. Just the kind ppl require….in simple plain english

    Taman
  8. Hi i have followed the instructions above and i get this:

    Forbidden
    You don’t have permission to access /svn on this server.

    ——————————————————————————–

    Apache/2.0.59 (Win32) SVN/1.3.2 PHP/5.2.0 DAV/2 Server at localhost Port 80

    Any ideas what might be wrong?

    Vince
  9. Vince,

    I had the same error, I changed “SVNParentPath” to “SVNPath” and it works like a charm.

    #new httpd.conf w/ SVNPath:

    DAV svn
    SVNPath D:/svnrepos

    FYI – I had best results updating the httpd.conf file then restarting Apache… I wasted so time until I figured out this was required.

    Hope this helps! Good luck.

    Jon
  10. This was very helpful! Thanks so much!

    Stevis
  11. I found these instructions whilst trying to get this working using Apache 2.2.4. Turns out it can be done, you just need to use update versions of the module files mod_dav_svn.so and mod_authz_svn.so that have been built against the Apache 2.2.x series. Copy these into the Apache modules folder instead of the ones that come with Subversion and it works like a charm!

    Modules available here:

    http://www.apachelounge.com/forum/viewtopic.php?p=4592#4592

    See the last two posts on the page for all the downloads you’ll need.

    Cheers,

    Hugh

    Hugh
  12. I had much difficulty getting the latest versions of
    SVN (as of March 2007) and ancillary applications
    to all behave correctly on a DOS platform but I
    was eventually able to wrestle the bear to the ground!

    Here is my tale…

    Getting SVN 1.4.3 to work on DOS (intentional reference
    to non-enterprise OS)

    Berkeley DB 4.5.20
    Apache 2.2.4

    Getting the repository setup:

    It was *VERY* difficult to get the first repository going under DOS!
    All the svn examples are for *nix systems and when it said to:

    svn import mysourcetree file:///svn/repos -m “a comment”

    I took the third forward slash in file:/// to be part of the *nix path
    to /svn/repos

    So I got stuck on trying to DOS-ify the example by

    svn import mysourcetree file://f:\svn\repos

    Anyway to make a long story short here are the magical incantations that I used
    to finally get an svn 1.4.3 repository created and loaded with my first rails
    project:

    svnadmin create –fs-type bdb f:/svn/svnrep
    ; top level svn repository location with Berkeley DB version 4.5.20
    ; latest as of Mar. 2007

    cd j:\data\eclipse
    ; my eclipse workspace directory

    rails depot
    ; create the rails skeleton for the depot application
    ; rails developers – recognize this?

    cd j:\data\eclipse\depot
    ; my rails eclipse project top level directory

    svn import file:///f:/svn/svnrep/projects/rails/depot

    Now I had the depot application in an svn repository – yeah!

    Maybe now I wanted to manage it via subclipse. Oh yeah babe!

    Here begins more problems setting up svn to run subclipse via Apache 2.2!!!!

    The mod_dav_svn.so apache modules that came with the one-click
    DOS installer for svn 1.4.3 were incompatible with the latest apache server
    version 2.2.4 that I had installed. I went back to the subversion
    web site and stumbled on this little note at the top of the download page

    ATTENTION!: The mod_dav_svn binaries available here are NOT compatible with Apache 2.2
    – see the Windows Apache 2.2.x folder.

    In there, I found the file: svn-win32-1.4.3.zip
    with description: Subversion 1.4.3 Win32 binaries for Apache 2.2.x.
    The filename is the same as a file in the original directory that apparently has
    different shared-object libs in it!!! SHIT!!

    Anyway, the one-click installer that I originally downloaded and used to install
    svn does magical things like add the all-important environment variable APR_ICONV_PATH
    (rrriiiigggghhhht!!) and the zip file does nothing of the sort so it isn’t good
    enough to unzip the apache 2.2 verson of svn. I ended up installing svn via
    the one-click DOS installer so that at least svn worked by itself. THEN I extracted
    the svn/bin/mod_dav_svn.so file from the apache 2.2 version of svn-win32-1.4.3.zip
    and put that file into c:\apache\apache2.2\modules then after some minor http.conf
    tweeks that actually matched the svn documentation, I was able to get apache to
    serve up the repository created above!!!!!!!

    Kirok
  13. Hey I added the:
    [html]
    DAV svn
    SVNPath R:\WAMP\SVN_Repository
    [/html]

    to the end of my httpd.conf but when i try to restart the server it gives me the following error:

    Syntax Error on line 499 of R:/WAMP/Apache2/conf/ httpd.conf:
    Invalid command ‘[html]‘, perhaps misspelled or defined by a module not included in the server configuration

    And Ideas?

    Robsie
  14. Instead try something like:

    DAV svn
    SVNParentPath R:/WAMP/SVN_Repository

    Incidentally, you want “ParentPath” if you intend to have multiple project repositories. “Path” is fine if you only plan one project, but it should point to the specific repository folder.

    Greg
  15. Hm, that didn’t format properly. Let me try again:

    <Location /svn>

    DAV svn
    SVNParentPath R:/WAMP/SVN_Repository
    <Location/>

    Incidentally, you want “ParentPath” if you intend to have multiple project repositories. “Path” is fine if you only plan one project, but it should point to the specific repository folder.

    Greg
  16. [...] Second, you must first set up subversion server with Apache correctly. I spent some time searched internet, and I believe this post:Configuring a Development Environment with Apache, Subversion, TortoiseSVN, and Subclipse by Aaron West is the most detailed version to teach you how to do this. However, please note that the article is use Apache 2.0.59; this is because the current subversion Apache mod, mod_authz_svn.so and mod_dav_svn.so are not compatible with Apache version above 2.2. Most of you may use XAMPP, since there are so many places recommend it, but the latest version of XAMP comes with Apache 2.2.X, so this will not work. I come a long way find a very interesting story about this: Getting SVN working with WebDAV on Windows… by Aral Balkan. Trust me, the author told the story very interestingly, and I nearly laugh all the time while I were reading it . Since I don’t want to and can’t compile Apache myself on my own machine, this story give me some hint that WAMP Server may works. However, when I go to WAMP Server official website, I found the current version of WAMP also comes with the Apache 2.2.4. Fortunately, I have saved a earlier version of WAMP on my hard driver before, so when I install that version, then I can configure the subversion server with Apache using the instructions find in Aaron’s post above. Anyway, the key here is that you must use Apache 2.0.x if you want to subversion server configured with Apache. [...]

    Read The Web
  17. Hi all.
    I’m using WAMP and SVN and modules for apache 2.2.4. It works fine, I mean when I checkout my repository it asks me to give a username and password but then tortoise (my svn client) shows me error:

    PROPFIND request failed on ‘/svn/testwin’
    PROPFIND of ‘/svn/testwin’: 500 Internal Server Error

    svn is installed on windows 2003.

    This is part of Apache configuration:

    DAV svn
    SVNParentPath C:/svn
    AuthType Basic
    AuthName “Repozytoria SVN”
    AuthUserFile c:/Subversion/svn-auth-file
    Require valid-user
    AuthzSVNAccessFile c:/Subversion/svn-acl

    My svn-acl file:
    [groups]
    developers = kris, ti

    [/]
    @developers = rw

    [svn:/testwin]
    @developers = r

    Everything’s ok when i use command line on server:

    svn checkout file:///svn/testwin

    Any ideas?
    Thanks – Kris

    Kris
  18. Hi! I have a problem, i’m using apache 2.0.59 and svn 1.4.4. All is fine, except when i put in the httpd.conf the following lines:

    DAV svn
    SVNParentPath G:\Repository\svn

    when i do that and try to start apache it throws that error: the service failed to start

    i have already load the modules and it works fine…
    Any ideas?

    Fabiana
  19. Subversion 1.4.4 with Apache 2.2.4 on Windows XP

    Install wamp from http://www.wampserver.com/ I used version 1.7.2 (I installed to c:\bin\wamp) (This installs Apache 2.2.4)
    Install subversion from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100&expandFolder=8100&folderID=8100 ( svn-win32-1.4.4_dev.zip )
    Unzip above to your install directory (mine is c:\svn)
    Edit environment path to include c:\svn\bin
    Create a repository directory with mkdir c:\MyRepos
    Create a repository with svnadmin.exe create C:\MyRepos
    copy c:\svn\bin\mod_dav_svn.so to C:\bin\wamp\Apache2\modules
    copy c:\svn\bin\mod_authz_svn.so to C:\bin\wamp\Apache2\modules
    copy c:\svn\bin\intl3_svn.dll to C:\bin\wamp\Apache2\bin
    copy c:\svn\bin\libdb44.dll to C:\bin\wamp\Apache2\bin
    edit C:\bin\wamp\Apache2\conf\httpd.conf and find and uncomment the following two lines:
    LoadModule dav_module modules/mod_dav.so
    LoadModule dav_fs_module modules/mod_dav_fs.so
    Add these two lines directly below the above two:
    LoadModule dav_svn_module modules/mod_dav_svn.so
    LoadModule authz_svn_module modules/mod_authz_svn.so
    At the very end of the file add:

    DAV svn
    SVNPath “C:\MyRepos”
    AuthType Basic
    AuthName “My Subversion Repository”
    AuthUserFile passwd
    Require valid-user

    Configure Apache Password File:
    C:\bin\wamp\Apache2\bin\htpasswd.exe -c C:\bin\wamp\Apache2\passwd myuser (Note that myuser is the username that you wish to use)
    This will prompt for a password.
    Restart Apache
    Test with svn list http://loclhost/svn (This should ask for your password from above and as we have not put anything in our repository nothing will list)

    Many thanks to:

    http://www.codeandcoffee.com/2007/07/24/how-to-setup-a-subversion-server-on-windows/
    http://aralbalkan.com/595

    John Devine
  20. There is a group of developers over at mindquarry.com that managed to get subversion working under xampp … not 100% sure about the webdav thing though …

    phalacee
  21. I had the same problem with DAV and location. Was able to work around this problem by uncommenting the following line in httpd.config file

    LoadModule dav_module modules/mod_dav.so

    Just in case I also uncommented (even though apache started without uncommenting this line)

    LoadModule dav_fs_module modules/mod_dav_fs.so

    I also had to change to , the appended line now looks like

    DAV svn
    SVNParentPath D:/svnrepos

    Edward Aguiar
  22. I have installed WAMP5 1.7.3 and Subversion 1.4.5 and have tried the above with no success. I copied the 2 so’s from the Subversion\bin into the Apache2\modules then I have:

    uncomment the following two lines:
    LoadModule dav_module modules/mod_dav.so
    LoadModule dav_fs_module modules/mod_dav_fs.so

    and

    Add these two lines directly below the above two:
    LoadModule dav_svn_module modules/mod_dav_svn.so
    LoadModule authz_svn_module modules/mod_authz_svn.so

    then tried to start the apache server but it wont start. If I comment out the 2 new lines the apache server starts.

    Is this combination of versions supported?

    Thanks

    Steve

    Ste Dyer
  23. I also struggled with WAMP and SVN, with no apparent succes for 2 hours now.

    Wouldn’t it be nice if someone would create a WAMPS package?

    Being a PHP developer is my job, not being a sysadmin…

    Oh well, let’s have another try…

    Vincent Bakker
  24. Just a little correction to the Greg’s post:

    The closing tag shoul be:
    </Location>
    instead of:
    <Location/>

    Something like this should work:

    <Location /svn>
    DAV svn
    SVNPath c:/svnrepos
    </Location>

    I using these versions and SVN works fine to me:
    WAMP5 Version 1.6.5
    Apache/2.0.59 (Win32) SVN/1.3.2 PHP/5.1.6 DAV/2 Server at localhost Port 80

    Mac
  25. Thanks for the additional info guys — very useful! :)

    Aral
  26. You may use apache 2.2.x, but you have to download svn binaries built against apache 2.2.x from svn.tigris.org

    Cheers.

    Nicolas.

    AbyZ
  27. Ditto what Nicolas said. I’m running against 2.2.4 with no issues.

    Rick
  28. Please note the addition to your apache.conf is written incorrectly in the posts here. Do mind the formatting or your apache server will not restart.

    DAV svn
    SVNPath D:/svn_repos
    #AuthType Basic
    #AuthName “My Subversion Repository”
    #AuthUserFile passwd
    #Require valid-user

    Here I’ve commented out the authentication lines to make sure it’ll work even if you didn’t create your password file.

    Colnector
  29. Yes – it fucked up my formatting as well, here’s another try:
    [code]

    DAV svn
    SVNPath D:/svn_repos
    #AuthType Basic
    #AuthName "My Subversion Repository"
    #AuthUserFile passwd
    #Require valid-user

    [/code]

    Colnector
  30. OK, last try – the first line should read
    [LESS THAN SIGN]Location[SPACE]/svn[GREATER THAN SIGN]
    and the last one
    [LESS THAN SIGN]/Location[GREATER THAN SIGN]

    <Location /svn>
    DAV svn
    SVNPath D:/svn_repos
    #AuthType Basic
    #AuthName “My Subversion Repository”
    #AuthUserFile passwd
    #Require valid-user
    </Location>

    Colnector
  31. Hi,

    I installed the Apache 2.2.8 and then integrate the subversion 1.4.6 with help of above posts and things are working fine. Now can someone please tell me how to implement the SSL at apache level to access the repositories.

    Thanks
    Naveed

    Asif Ahmad
  32. Comments from Marcos will solve my problem. I was spend 3 hours to install Subversion 1.4.3 support on apache 2.2.8.

    Thanks Marcos :-)

    Liju
  33. edit:
    ** Find:

    Include

    ** and add in new line after:
    {lt}Location /svn{gt}
    DAV svn
    SVNPath C:/{Repository Location}
    Order allow,deny
    Allow from all
    AuthType Basic
    AuthUserFile passwd
    AuthName “Internal area”
    require valid-user
    {lt}/Location{gt}

    Christian Blanquera
  34. Sorry for the spam. Trying to get this formatting right, ignore the last 2 posts i made. {lt} and {gt} represent the keyboard character “less than” and “greater than”. AND AWAY WE GO !

    ** Download http://svn1clicksetup.tigris.org/files/documents/3106/33794/Svn1ClickSetup-1.3.3.exe
    ** Execute “WampServer2.0c.exe” – When you get to the “Select Destination Location” Step remember the location (ie. C:\wamp). This will bee the {WampServer2.0c.exe install directory} in this instructions

    ** Download http://www.wampserver.com/dl.php
    ** Execute “SvnClickSetup-1.3.3.exe” – When you get to the “Repository Location” Step remember the location (ie. C:\svnrepos). This will be the {Repository Location} in this instructions

    ** Download http://members.cox.net/~pminer/svn/mod_dav_svn.zip
    ** Download http://members.cox.net/~pminer/svn/mod_authz_svn.zip
    ** Copy “mod_dav_svn.so” and “mod_authz_svn.so” to {WampServer2.0c.exe install directory}\bin\apache\apache2.2.8\modules\

    ** Download http://members.cox.net/~pminer/svn/libdb44.zip
    ** Download http://members.cox.net/~pminer/svn/libapr.zip
    ** Copy “libdb44.dll” and “intl3_svn.dll” to {WampServer2.0c.exe install directory}\bin\apache\apache2.2.8\bin\

    ** Execute {WampServer2.0c.exe install directory}\wamp\wampmanager.exe (a white half circle will show up on the right side of the task bar)

    ** Left click the white half circle -> Apache -> httpd.conf (this opens the file)

    ** Find:
    #LoadModule dav_module modules/mod_dav.so
    #LoadModule dav_fs_module modules/mod_dav_fs.so

    ** and add in new line after:
    #LoadModule dav_svn_module modules/mod_dav_svn.so
    #LoadModule authz_svn_module modules/mod_authz_svn.so

    ** Right click the white half circle -> Exit

    ** Execute {WampServer2.0c.exe install directory}\wamp\wampmanager.exe (a white half circle will show up on the right side of the task bar)

    ** Left click the white half circle -> Apache -> Apache Module -> dav_module
    ** Left click the white half circle -> Apache -> Apache Module -> dav_fs_module
    ** Left click the white half circle -> Apache -> Apache Module -> dav_svn_module
    ** Left click the white half circle -> Apache -> Apache Module -> authz_svn_module

    ** run cmd (Start -> run: cmd )
    ** run in cmd
    C:\{WampServer2.0c.exe install directory}\bin\apache\apache2.2.8\bin\htpasswd.exe -c C:\{WampServer2.0c.exe install directory}\bin\apache\apache2.2.8\passwd {Whatever username you want (ie. myuser)}

    ** It will ask you for a “New Password”: Make up your own
    ** It will ask you to “Re-type new password”: repeat

    ** Left click the white half circle -> Apache -> httpd.conf (this opens the file)

    ** Find:
    {lt}/IfModule{gt}

    Include

    ** and add in new line after:
    {lt}Location /svn{gt}
    DAV svn
    SVNPath C:/{Repository Location}
    Order allow,deny
    Allow from all
    AuthType Basic
    AuthUserFile passwd
    AuthName “Internal area”
    require valid-user
    {lt}/Location{gt}

    ** Left click the white half circle -> Restart All Services

    Christian Blanquera
  35. like a charm but use <location instead of [html]

    DAV svn
    SVNParentPath D:/SVNRepository

    Orkun Alabaz
  36. Hi Aral,

    I dont want to go back to Apache 2.0.x so i found this page with svn modules built against Apache 2.2.x, i hope this will be useful to others readers, i’ll let you know if works for me (Actually XAMPP 1.7.3 and VisualSVN on a Windows 2008 R2 Server)

    http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100

    Jesus Mogollon
  37. i have wamp installed with appache version 2.2.11. How do i install SVN on my local mechine??

    asifsomy
  38. Hi Aral, I´m trying to use One-Click SVN Installer, with WAMP, but but wamp cames with apache 2.2 and in the event viewer I got this message:
    The Apache service named reported the following error:
    >>> s this is not an Apache module DSO, or was compiled for a different Apache version? .
    How Can I resolved this? Can you help me please?
    Because the server in my company is 2.2 too,
    Thanks

    Rodrigo Bereta