See the comment dead links below for up to date information on how to do this.
Step by step instructions on installing Apache and Subversion on Windows and creating and securing a repository.This is very easy as there is a Subversion Windows installer here.
This will be an Apache based Subversion server.
Download and install Apache 2.0.x (where 'x' is 52 or above) from here and the latest version of Subversion from here. If you are using Windows/XP Service Pack 2 you will have to permit the firewall to allow traffic to Apache on port 80.
These instructions assume that Apache is installed in C:\Program Files\Apache Group\Apache2 and Subversion is installed in C:\Program Files\Subversion. Version 2.0.50 of Apache and 1.0.5 of Subversion were used when writing these instructions.
Provided Apache was installed first the Subversion installer will put all the module files and dll's which are required into the Apache modules and bin directory. The 1.1.1 installer fails to configure Apache correctly (intl.dll is missing) and the httpd service is uninstalled. To recover this open a command prompt, go to your Apache installation directory (C:\Program Files\Apache Group\Apache2\bin) and type Apache -k install. Also copy C:\Program Files\Subversion\bin\intl.dll to C:\Program Files\Apache Group\Apache2\modules. You should then be able to start the Apache service using the Apache Service Monitor which is installed in the task bar.
Let's say you want your repository to be in c:\svn\repos, type in these commands in a command prompt:
> mkdir c:\svn > svnadmin create c:\svn\repos
Edit the Apache configuration file, follow the Windows menus:
Start/All Programs
/Apache HTTP Server 2.0.50
/Configure Apache Server
/Edit the Apache httpd.conf Configuration File
In the modules section of the file uncomment:
LoadModule dav_fs_module modules/mod_dav_fs.so
The subversion modules will have been added by the installer.
Then at the bottom of the file add:
<Location /svn/repos> DAV svn SVNPath c:\svn\repos </Location>
Now restart Apache by double clicking the Apache Service Monitor icon in the taskbar and click the Restart button. If Apache isn't currently running use the Start button instead.
The Subversion server should be running. Point your browser at http://your.server.name/svn/repos and you should see something like this:
Revision 0: /
Powered by Subversion version 1.0.5 (r9954).
That's it, you now have a fully functional Subversion server.
You have a working server but with no user authentication so anyone can use it. This has the knock on effect that the server doesn't know who is making commits and so cannot set the svn:author property on that revision.
Subversion supports http basic authentication. To use this you need to add the following to the Apache Location directive and restart Apache:
AuthType Basic AuthName "Subversion Repository" AuthUserFile c:\passwd\passwords Require valid-user
Then you must create the passwords file:
> mkdir c:\passwd > "c:\Program Files\Apache Group\Apache2\bin\htpasswd.exe" -c c:\passwd\passwords username Automatically using MD5 format. New password: ******* Re-type new password: ******* Adding password for user username
You don't have to put the password file at this location, change the paths if you would prefer to store it somewhere else. The -c flag creates a new file, to add more users leave out the -c.
Now if you visit the URL http://your.server.name/svn/repos you should be prompted for your user name and password.
See hints here.
For more detailed information on configuring Apache and access permissions see
Chapter 6 of the subversion book.
You can find a non-Apache based setup guide at http://excastle.com/blog/archive/2005/05/31/1048.aspx?Pending=true
dead links
The URLs provided for downloading Windows binaries are stale. The volunteers who formerly maintained Subversion installers at Tigris.Org no longer do so, because there are now professionally built and tested (and still free!) versions available, such as those at
http://www.open.collab.net/downloads/subversion/
Also, the latest server binaries there include the Apache httpd server, ViewVC, and a web-based admin console, making even server set-up into a simple one-click installer.
The path was not part of a repository
Thanks for the directions, they work quite well. I can open http://localhost/svn/sandbox/ in my browser and I get
as expected. However I cannot actually get the code from there. I get the following error:
Any ideas? Thanks
Yes! Import!
Use svn import to put something into your repository first, then check that out.
Setting up for Multiple Repositories
Hi I am struggling with setting the Subversion for multiple repositories. At the beginning, I was able to set it up for a single repository. The following is the corresponding section in the httpd.config file:
Now I replaced it with the following for multiple repositories:
My intention is to allow the user to access the common parent URL and then navigate to the individual repositories, such as AWUpdater. However, when I tried to access the repository, IE told me that I did not have the permission. Can you gurus there help me with the problem? Thanks,
Xiaoan
Setting up for Multiple Repositories
First it looks like your parent path is wrong. Your first example shows your repository in the
C:/SVN/Prototypesdirectory so maybe yourSVNParentPathshould be set to that.If that isn't the problem then try removing the
SVNListParentPath onandAuthzSVNAccessFile svnaccessfile.txtlines and see if it then works. If it does it is a fault with yoursvnaccessfile.txt.Confusion Continues
I've installed Apache HTTP Server 2.2.2
I've installed Subversion 1.3.0
Subversion didn't touch Apache in its installation...!!
As per the comments, I've copied mod_dav_svn.so over but experience the message
mod_dav_svn.so is garbled - perhaps this is not an Apache module DSO?
Any clues?
Use Apache 2.0
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.
One More Step...
I also found it necessary to remove the comment mark (#) from the following line in httpd.conf:
Until I did this I continued to get the following error:
I am running SVN 1.3.2, Tortoise 1.3.5 and Apachee 2.0.58 on a Windows 2003 Server.
caveats
Couple of minor points.
You need to copy the mod_dav_svn.so file from the subversion installation directory into the apache modules directory. Then add the following in httpd.conf:
LoadModule dav_svn_module modules/mod_dav_svn.so
Otherwise you get 'unknown DAV provider svn'
Also, if you have IIS running on port 80, you either need to stop the service when installing apache (otherwise the service doesnt get installed, due to port conflicts), or install using the 'use port 8080' option.
Cheers for the fine manual.
Subversion Installer
I am pretty sure that if Apache is installed prior to installing Subversion that these steps are done for you.
Oops - Apache 2.2 is the culprit...
I just found this note:
"Note that the Apache modules included in this package was compiled against Apache HTTP Server 2.0, and thus will not work with Apache HTTP Server 2.2." - attached to the Windows installer.
Since I installed this from scratch today I pulled the most current Apache, which is 2.2, and thus...
Hopefully this will help someone else!
Joel
Installer seems to be missing a few things...
The installer did not seem to include and place mod_dav_svn.so in the Apache modules directory, and did not add the LoadModule line to the httpd.conf file.
This was a "squeaky clean" install on a Win XP Pro box. The one possible factor is that IIS was installed on the box, but was *not* listening on port 80 - it was configured for port 81. Why this could affect placing a module correctly I don't know - my guess is that it was just plain missing from the installer codeline...
If I'm missing something please let me know.
Joel