I had to add http access for our SVN repository at work, which was happily serving on the default SVN port. However after changing to our new network the SVN port has been shut down and the IT guys are in no hurry to open it up. I thought I remembered Apache can be chained with SVN for http access, went looking and sure enough. So here is a quick step tutorial with minimum configuration if you need to do the same.
1 – Download and install Apache 2.2
I’m installing at c:\apps\apache2.
2 – Copy modules from Subversion to Apache modules
3 – Modify the Apache httpd.conf to load the SVN modules
Add the following two lines to your
file, just look for all of the lines that start with LoadModule, put them at the end of the list
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
Now un-comment this line in httpd.conf, it will look like this
LoadModule dav_module modules/mod_dav.so
4 – Add your svn location info to httpd.conf
At the very bottom of your httpd.conf file add these lines:
AuthName "Subversion Repository"
5 – Create an Apache password file
To allow Apache to handle authentication for you, you’ll need to create a password file. Open a command prompt,
htpasswd –c passwords.pass newuser
Enter the password for newuser, to add additional users
htpasswd passwords.pass anotherUser
When you have added all the users copy the passwords.pass file over to the
6 – Start the Apache service from Services
If you get errors open dos window and run Apache manually
You should see the errors reported.
7 – Access your repository over http
With Tortiese goto the repo browser, enter the appropriate path, something like the following.
You will be prompted for the user and password and should be all good to go. You should also be able to open the location in a web browser.
This quick step guide is based on the more comprehensive guide at inetsolution. That guide is great and covers setup of SVN+Apache, SSL access and group permissions.