How to Setup a Subversion Server on Windows
Posted on July 24, 2007, under Development, How To, Operating Systems, Software, Subversion, Tools and Services.
A while back I wrote an How To on how to setup a Subversion server on Linux. So anything you can do on Linux you should be able to do on Windows, right? Well I am not getting into that debate, but yes you can setup a Subversion server on Windows. Much like Linux there are many ways to accomplish this, today I will be talking about how to set it up using Apache. So let’s take a look…
Downloads:
These are the recent versions of this date, please check for the latest stable versions at time of install.
Install:
First lets install Apache. You should be able to select all of the defaults during the installation process, unless you know what you are specifically trying to accomplish. Be sure to select “Apache Modules” where it talks about the SVN module.
Second lets install SVN, again the defaults work fine.
Third, and last install TortoiseSVN, yup defaults work good for this as well.
Configure Apache Password File:
First lets create a Apache password file, from a command line run:
[ftf]
C:\Program Files\Apache Group\Apache2\bin\htpasswd.exe -c C:\Program Files\Apache Group\Apache2\passwd myuser
[/ftf]
Be sure to replace “myuser” with the username you wish to use for your login.
Create a Repository:
Next we need to create a subversion repository:
[ftf]
C:\Program Files\Subversion\bin\svnadmin.exe create C:\MyRepos
[/ftf]
Configure Apache:
In Notepad open up the file “C:\Program Files\Apache Group\Apache2\conf\httpd.conf” and put the following at the end of the file:
[ftf]
DAV svn
SVNPath “C:\MyRepos”
AuthType Basic
AuthName “My Subversion Repository”
AuthUserFile passwd
Require valid-user
[/ftf]
Presto! All you need to do is restart Apache via the neat little system tray icon, and import your repository and you are up and rolling.
Popularity: 26% [?]
10 Replies to "How to Setup a Subversion Server on Windows"
Gerard on July 30, 2007
The Apache 2.2.4 and Subversion 1.4.4 you link to are not compatible with eachother, that Subversion installer is built for the Apache 2.0.52 version. As far as I’m aware there is no 1.4.4 installer that is Apache 2.2.4 compatible, only a ZIP-file version. Your command lines also seem to be based on Apache 2.0 rather than 2.2.
John Devine on August 2, 2007
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 on August 2, 2007
Sorry the formatting lost some stuff!!! The above should read:
DAV svn
SVNPath “C:\MyRepos”
AuthType Basic
AuthName “My Subversion Repository”
AuthUserFile passwd
Require valid-user
John Devine on August 2, 2007
Sorry about this but the formatting just gets eaten. I will try one more time and spell it out
“Less than symbol” Location “forward slash”svn “greater than symbol”
DAV svn
SVNPath “C:\MyRepos”
AuthType Basic
AuthName “My Subversion Repository”
AuthUserFile passwd
Require valid-user
“Less than symbol”"forward slash”Location”greater than symbol”
Maarten Van Lint on October 13, 2007
the file svn-win32-1.4.4_dev.zip didn’t contain the binaries (possibly renaimed and re-arranged). I did get svn-win32-1.4.4.zip. and the thing seems to work at the moment. Thnkx a lot for the explanation on how to get this working :o)
Jeff Harding on October 17, 2007
I have done the above with WAMP 1.7.3 and SVN 1.4.5. Everything works except when I go to http://localhost/svn it asks for credentials and then gives me an Internal Server Error
“Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.”
Any ideas?
Mayur on October 22, 2007
I had the same “internal server error” problem. No idea how to fix it.
Corrections to the WAMP install
===============================
- Turns out Apache wont start if there are spaces in AuthName.
- The locations for the various wamp .so and .dll files are incorrect. Works manually.
Skyler Sully on October 28, 2007
To fix that “internal server error” problem, you have to actually create the password file.
Simply do the command below, replacing with the username of your choice:
>
C:\path\to\Apache Group\Apache2\bin\htpasswd.exe -c C:\path\to\Apache Group\Apache2\passwd
(Be sure to put the correct location of the Apache Server)
You will then be prompted for a new password and when you go to http://localhost/svn, put in the username and password you designated and you should be set.
Cheers.
Skyler Sully on October 28, 2007
CORRECTION:
> C:\path\to\Apache Group\Apache2\bin\htpasswd.exe -c C:\path\to\Apache Group\Apache2\passwd {username}
{username} should be replaced by the username of your choice without brackets



University Update - Linux - How to Setup a Subversion Server on Windows on July 24, 2007
[...] Link to Article linux How to Setup a Subversion Server on Windows » Posted at Code and Coffee [...]