Guide To Installing the Subversion HTTP Module on Windows
After creating an installer to assist with setting up Subversion repositories on Windows, I started wondering how hard it would be to make a repository visible through HTTP. When comparing the different server configurations in the Subversion book they say that the HTTP server is “somewhat complex” to set up. Despite the warning that it was complex, I proceeded to get a repository up and running within a couple of hours (although it took me longer when I walked through my steps to write this guide for some reason). I thought that I would share my experience, and hopefully this guide will assist those you who would like to be able to use Subversion through HTTP.
- Download the binaries
Go to the Apache download page and download the latest version of their web server. As of the writing of this article it was 2.0.54.
Go to the Svn1ClickSetup download page and download the latest version. As of the writing of this article it was 0.8.3.
- Set up Subversion
Run the Svn1ClickSetup executable downloaded in the previous step. When I refer to installation locations later in this guide, I will be assuming you installed everything in their default locations. If you install anything in a different directory, you will need to make the necessary adjustments.
Note: Svn1ClickSetup installs a Subversion service, if you don’t want to be running this service, open a command prompt, and run the following command:
svnservice -remove
- Install Apache
Run the Apache installer that you downloaded. I had never installed Apache before, but the defaults worked fine for me.
Once the installation finishes, launch a web browser, and browse to http://localhost. If you see a test page from Apache, the server is installed correctly.
- Set Up HTTP Access
The first thing we need to do is make sure that Apache loads the WebDav modules. The Apache config file (httpd.conf) is located in the C:\Program Files\Apache Group\Apache2\ conf directory. Launch a text editor, and open the Apache config file. You will want to keep this file open for the rest of the installation.
Copy the Subversion HTTP module (Program Files\Subversion\bin\mod_dav_svn.so) into the Apache modules directory (Program Files\Apache Group\Apache2\Modules).
In the config file, look for a section of lines that all start with LoadModule. At the end of that section, add the following lines:
LoadModule dav_module modules/mod_dav.so LoadModule dav_svn_module modules/mod_dav_svn.so
At this point, restart the Apache2 service (Control Panel > Administrative Tools > Services). You will probably want to keep the Services window open (we will be restarting Apache several more times). If it restarts with no errors, Apache is now loading the SVN module.
Back in the Apache config file, add the following to the end of the file:
<Location /repos> DAV svn SVNPath "C:\svnrepos" </Location>
Restart Apache2 again, and if it restarts successfully, go ahead and pat yourself on the back. You can now access your repository via HTTP (that wasn’t so bad, was it?)
- Configuring Authentication
One small note before we start looking at authorization. There are several different ways you can configure authorization for Subversion, but I am only going to show you basic authorization in this guide. Basic authorization sends the passwords in near plain-text, so if you are concerned with password snooping, you will want to use a different authorization scheme.
At this point, we can browse our repository via HTTP. Not only that, but we can also check-out, modify, and commit changes. However, none of these operations require any type of authorization. Not exactly what we want, especially if we are going to have multiple users.
To enable authorization, we need to tell Apache who the authorized users are. To do this, we give Apache a file with a list of the authorized users and their passwords. Apache makes this job easy by providing a utility to mange the user file, htpasswd.
Let’s go ahead and create our user file with the users Alice and Bob. We are going to put our file in the Apache conf directory, so open a command prompt to that directory (Program Files\Apache Group\Apache2\conf). Type the following command, and then enter a password for Alice.
C:\Program Files\Apache Group\Apache2\bin\htpasswd -cm svn-auth-file Alice
Now type in the following command to add Bob to the file.
C:\Program Files\Apache Group\Apache2\bin\htpasswd -m svn-auth-file Bob
Notice the difference between these two commands. The first command passes in the -c command, which tells htpasswd to create the file. The second time, the file already exists, so we don’t want it to be re-created. The second command is what you would use to add additional users to the file. If you look at the svn-auth-file, you will see entries for both Alice and Bob.
Now that we have our authorization file, we need to tell Apache where to look for it. Go back to the Location tag that we added to the Apache config file. We need to add some more lines to it so that it looks like this
<Location /repos> DAV svn SVNPath "C:\svnrepos" AuthType Basic AuthName "Subversion repository" AuthUserFile "C:\Program Files\Apache Group\Apache2\conf\svn-auth-file" Require valid-user </Location>
After restarting Apache2 once again, browse to your repository again. This time, you will be prompted for a user name and password. Cool, we have authorization working. However, I don’t want to be prompted for a user name unless modifying the repository, so we’re not quite finished yet.
Thankfully, only requiring authorization for modifications is really easy. All we have to do is add a couple more lines to our location tag so that it looks like this
<Location /repos> DAV svn SVNPath "C:\svnrepos" AuthType Basic AuthName "Subversion repository" AuthUserFile "C:\Program Files\Apache Group\Apache2\conf\svn-auth-file" <LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user </LimitExcept> </Location>One last restart of Apache, and we now have the Subversion HTTP module installed, configured, and ready to control our revisions.
October 7th, 2005 at 9:22 am
Dude! You are my hero… Thank you so much for the installer and this tutorial :o) If there were more people like you, Open Source would rule the world :o)
Cheers
-michael
October 19th, 2005 at 8:22 am
Thanks a lot for your tutorial.
I’ve just have a problem to activate the WebDav support:
Apache was unable to load the mod_dav_svn.so module.
To workaround this, I’ve use the Dependancy Walker to lookup the the needed dll (as suggested in the Subversion FAQ) and copied these dll in the Apache modules folder:
intl3_svn.dll, libapr.dll, libapriconv.dll, libaprutil.dll, libdb43.dll, libeay32.dll, libhttpd.dll, ssleay32.dll.
Part of these dll are located in the Apache bin folder and the other in the Subversion bin folder.
This seems to tricky, so let us know if there is a way to install the bundle without this problem.
Regards,
Eric
October 19th, 2005 at 5:44 pm
Eric,
The easiest way to get around this problem is to make sure that the subversion bin directory is on your PATH environment variable. Is it is, Apache should be able to load all of the other dlls.
Brian
October 20th, 2005 at 10:13 am
Thanks Brian,
I’ve added the Subversion bin directory in my PATH environment variable, but it seemed to not solve the problem.
However, after rebooting my PC (XP SP 2) and removing the dll I previously copied, every thing runs as expected.
Regards,
Eric
October 20th, 2005 at 5:07 pm
[…] I started out reading Brian’s guide to installing everything. Now, I didn’t use his one-click installer, but I followed the rest. Notably, I believe the system account on our server didn’t pay attention to the path I had set system-wide, as it could not load the Subversion modules unless I gave it absolute paths for everything. But I got that working. It was interesting to note that when I had Apache installed, the Subversion installer actually offerred to install and configure the modules for me. I had Subversion access through HTTP. […]
October 28th, 2005 at 8:55 am
This tutorial is great. Thanks a lot for writing it. My only change was I used Netserver, a pack of servers for Windows NT/2000/XP with a gui controller. It worked without a hitch, the first time.
http://netserver.hugosoft.net/
March 16th, 2006 at 2:24 am
Thx for another great tutorial, although correcting the spelling in the URL and title would make your howto easier to track down in search engines …
Cheers!
June 21st, 2006 at 3:44 pm
Hugely helpful! Accomplished in ten minutes what I couldn’t get done in ten hours! Thanks!
July 26th, 2006 at 12:16 am
Dear Brian,
I installed SVN 1.3.1 and Apache Sever.Is it possible to give any authorization in folder level in the repository.what changes needed for that.
Please help me.I am in trouble
subash
July 29th, 2006 at 7:34 am
Thanks for this tutorial! I wanna tell you the problem where I get stucked.
If someone has the following error message:
mod_dav_svn.so is garbled - perhaps this is not an Apache module DSO?
Here is a possible solution:
Apache 2.2 is compiled with a version of Visual Studio which is not compatible with the Subversion build. Use Apache 2.0 and the Subversion modules will work.
I found this at http://www.subversionary.org/howto/setting-up-a-server-on-windows
June 20th, 2007 at 3:05 pm
That solution for “mod_dav_svn.so is garbled” problem isn’t real solution, as Apache 2.0+SVN is broken too (at least for Linux servers). The only known for me solution at a moment of this writing is to downgrade to the latest stable combination of apache+svn+neon, which use apr:0 (0.9x) (not apr:1)
July 27th, 2007 at 3:08 pm
Nice. Just what i was looking for. Thanks
NC Tech Support Team
Brian Nailer
August 6th, 2007 at 7:55 pm
Regarding the “mod_dav_svn.so is garbled” problem:
The version of Subversion that is installed currently with oneclick is not compatible with Apache 2.2. If you go to subversion.tigris.org you will see there is now a choice to download binaries compiled against apache 2.2. You can download this zip file and overwrite your Program Files\Subversion folder with the new versions. Then re-copy the .so module files.
August 8th, 2007 at 9:17 pm
Many thanks for putting this together! Saved me a ton of pain.
December 9th, 2007 at 2:42 am
Took me a little over an hour because I grabbed the latest version of everything.
Found out that you have to use Apache 2.0, with Subversion 1.3. Tried Apache 2.2, but the Subversion modules were compiled with Apache 2.0, so when I pulled them over, got a config error from Apache. Didn’t have the tools to re-compile the modules.
Found this:
http://svn.haxx.se/users/archive-2006-09/0526.shtml
December 10th, 2007 at 5:11 am
Here i installed subversion and apache. both are working fine. i made some changes in httpd file for user access. here as ur blog this will work for only one repository but i want many repository and not all users access all repository i want to give some restriction on each repositor. so pls guide me.
February 14th, 2008 at 5:47 am
I couldn’t get SVN 1.4.5 + Apache 2.2.8 working
“mod_dav_svn.so is garbled” issue wasn’t sorting out
Jason’s suggestion couldn’t do.
However Apache 2.0.63 + Svn1ClickSetup-0.8.6 did the job.
-Nishant
April 12th, 2008 at 11:48 pm
None…
None…
April 13th, 2008 at 10:22 pm
roulette live…
…
April 14th, 2008 at 7:44 am
regles poker texas hold…
…
April 18th, 2008 at 4:09 am
Awesome!!! thanks
April 30th, 2008 at 11:39 am
online card game casino free casino card game…
All the texas holdem blatt advance cash loan online payday…
May 1st, 2008 at 3:26 am
easy online cash advance online cash advance…
Furthermore bonus casino bonus des casino…
May 1st, 2008 at 10:42 am
casino club roulette…
Find motorola razr ringtones roulette online games…
May 3rd, 2008 at 3:40 am
regles poker no limit…
Contact chicago in loan payday store cash loan payday til…
May 3rd, 2008 at 5:56 am
telecharger evereste poker…
It must be noted juegos de poker online gratis telecharger winamax poker…
May 3rd, 2008 at 9:41 am
loan payday till info loan payday till…
In the first case www party poker com online spiele roulette…
May 3rd, 2008 at 11:50 am
cash advance america bank of america cash advance advance america cash loan…
Choose instant approval cash advance super poker…
May 4th, 2008 at 7:16 am
supprimer casino online…
Pay aces texas holdem multiplayer slotmachines spielen…
May 5th, 2008 at 3:57 pm
free poker download…
Recently grace casino ace cash advance…
May 6th, 2008 at 5:54 am
www poquer…
So far card credit interest lowest uk flash game poker texas holdem…
May 6th, 2008 at 3:51 pm
cricket free ringtones…
More than one of cash fast loan payday music real ringtones ringtones…
May 6th, 2008 at 4:27 pm
giochi casino flash…
At texas holdem online cash advance payday loan software…
May 6th, 2008 at 8:56 pm
account advance cash fax no saving no fax cash advance…
Furthermore account advance cash fax no saving cash advance service…
May 28th, 2008 at 7:45 am
online casino bonus no deposit casino bonus casino bonus…
Also casino slot gioca poker poker a jouer gratuitement beste online poker strip poker party…
June 9th, 2008 at 6:28 am
juegos de poker gratuitos…
Spielen jouer au poker gratuit texas holdem regelwerk holdem poker strategie internet poker site casino gratis…
June 20th, 2008 at 10:48 am
regle du poker…
No matter free nokia ringtones tracfone poker multijugador gratis play casino online free video poker game roulette paginas internet…
July 2nd, 2008 at 6:00 pm
poker descubierto…
Asi giochi slots go phone ringtones download midi ringtones maker ringtones xingtone jugar seven card stud…
July 4th, 2008 at 7:25 am
telecharger partie poker…
However poli poquer draw poker on line juegos strep poker gioca a poker gratis 7 card stud en ligne…
July 11th, 2008 at 2:18 pm
www casino en ligne…
Selten deposit bonus casino poker on line gratis draw poker on line online poker for fun jeu casino gratuis…