<

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Configure SVN with APACHE web Server

Published on
9,732 Points
3,732 Views
Last Modified:
Approved
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? (http://subversion.tigris.org/)
      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 : http://en.wikipedia.org/wiki/Svn_%28software%29)

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. http://httpd.apache.org/download.cgi. If you already have IIS running on your machine please make sure you set a different port number for APACHE installation, more info here http://httpd.apache.org/docs/2.0/platform/windows.html (thanks to Garth J Lancaster for pointing out the link)
"      SVN Server
      SVN can be downloaded from the following URL
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100
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 http://tortoisesvn.net/downloads .

IT IS ADVISABLE TO RESTART YOUR MACHINE AFTER THE INSTALLATION.

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 (mod_authz_svn.so and mod_dav_svn.so) 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/mod_dav_svn.so
LoadModule  authz_svn_module modules/mod_authz_svn.so

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      
subversion.conf      
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
</Location>

name of the file
svn-auth-file      
#EMPTY FILE

Name of the file
svn-acl      
Content of the file
#
# specify groups here
#
[groups]
developers = harry,sally

#
# team1 group has a read/write access to source code repository
# all subdirectories
# all others have read access only
#
[SourceCodeRepos:/]
@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.



Setting-up-SVN-Server-using-Wind.doc
0
Comment
Author:Jai S
0 Comments

Featured Post

Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Join & Write a Comment

If you, like me, have a dislike for using Online Subscription anti-spam services, then this video series is for you. I have an inherent dislike of leaving decisions such as what is and what isn't spamming to other people or services for me and insis…
Make it easier to see the current record on your Microsoft Access forms! To highlight the current record with a yellow background color, use Conditional Formatting, a control to keep track of the primary key value, a control to change color, and a l…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month