Configure SVN with APACHE web Server

Jai STech Arch
Setting up SVN Server using Windows and Apache

Purpose of the document:
      This article will explain the process of how to configure SVN repository in a windows environment using APACHE web server.

What is SVN? (
      Subversion (SVN) is a version control system initiated in 1999 by CollabNet Inc. It is used to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly-compatible successor to the widely used Concurrent Versions System (CVS).(WIKI link :

Required software(s):
"      APACHE web Server
      The latest version of APACHE is Apache HTTP Server 2.2.14, more information on installation and download details is available in APACHE web site. If you already have IIS running on your machine please make sure you set a different port number for APACHE installation, more info here (thanks to Garth J Lancaster for pointing out the link)
"      SVN Server
      SVN can be downloaded from the following URL
File name: Setup-Subversion-1.6.4.msi

"      Tortoise SVN or equivalent client
      For accessing the SVN repository you will need client software that needs to be installed, Tortoise SVN is one of the client tools for accessing SVN repository. It can be downloaded from .


Setting up the repository

STEP 1: Creating a repository
On the server, create a directory D:\SourceCodeRepos, this directory will hold the files of our source code repos.

Open Command Prompt and type

svnadmin create D:\SourceCodeRepos

(If you get an error bad command or filename then add the SVN bin path to the environment variables. Go to Desktop à right click MyComputer > Properties > -> Advanced -> Environment Variables > Path > Edit > dont overwrite the existing one> copy the bin path of SVN (generally it is c:\Program Files\Subversion\bin) in the end.)

STEP 2: Configure APACHE to work with SVN
Copy the SVN modules to APACHE
      The SVN modules are available inside (C:\Program Files\Subversion\bin), copy these two files ( and to c:\Program Files\Apache Software Foundation\Apache2.2\modules

Open C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf, and append the following lines to it
#This will load the SVN modules so that APACHE can communicate with SVN Server
LoadModule  dav_svn_module modules/
LoadModule  authz_svn_module modules/

Add the following line to the end of the same conf file
Include c:/etc/subversion.conf

Step 3: Configure Authentication parameters and SVN Repository link

Create a new directory c:\etc. Create 3 files inside this directory
Name of the file      
Content of the file
<Location /SourceCodeRepos>
  DAV svn
  SVNPath D:/SourceCodeRepos

  AuthType Basic
  AuthName "Subversion Kinetics repository"
  AuthUserFile c:/etc/svn-auth-file

  Require valid-user

  AuthzSVNAccessFile c:/etc/svn-acl

name of the file

Name of the file
Content of the file
# specify groups here
developers = harry,sally

# team1 group has a read/write access to source code repository
# all subdirectories
# all others have read access only
@developers = rw
* = r

Now RESTART the APACHE WEB SERVER, so that it can load the SVN modules and point to your directory.

Step 4: Setting up authentication parameters
      Now that the repository is configured we need to create the username / password for accessing the repository

htpasswd -m c:\etc\svn-auth-file user1
htpasswd -m c:\etc\svn-auth-file user2
htpasswd -m c:\etc\svn-auth-file user3

This will create 3 users and the usernames will be appended to the svn_auth_file that was created in the previous step.

Checking your Configurations
Open the URL from the server as http://localhost/SourceCodeRepos, this will list the current version number of the repository.

Now from any other machine (connected to the server), install Tortoise SVN and create a new working folder (eg: D:\Dev), Windows explorer to the folder D:\Dev, right click and select SVN Checkout, specify the URL of your source code control, (eg: http://servername/SourceCodeRepos) if asked for username and password, please provide the username and password that you have created in the earlier steps. Your SVN Source repository is ready to use.

Now test your environment by adding a new file to the repos and committing the changes. More information on how to create new files / folders is available in the SVN book which is freely downloadable.


Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.