Installing Subversion? Just follow this 7 Steps

During  this week I had installed and configured Subversion and Cruise Control in my office. We all know its relatively simple to configure these but then also here in this post I am just writing the installation and configuration of Subversion into some simple steps. Hope it will be helpful to any of you in future [ Surely. for me too ;) ].

Versions used here are:

Apache HTTP Server 2.2 [ Download] and Subversion 1.4.6 [Download]

1. Installing Apache HTTP server.

Download the Apache HTTP Server from Here. You can download the binary version or the Windows installer from the site. Specify a location to install, for example here Im using D:\Subversion\Apache\Server.

2. Installing Subversion.

Download the Subversion installer from Here. Just follow the steps in the instalation wizard to install the subversion. Here I am installing subversion into the root folder with a different child direcotry. D:\Subversion\Subversion

3. Configuring the Apache Server.

Okey.. So u completed two “Complex” :) steps now. But the third one is  very simple. It contains two steps

  1.  
    1. Copy the files mod_authz_svn.so and mod_dav_svn.so from the [Installation path]\Subversion\bin folder to the [Installation path]\modules folder. Actually we are adding two module files into the Apache server.
    2. Go to the conf directory of Apache server [Installation path]\conf and edit the httpd.conf file. Add the following lines into the modules including part

LoadModule  dav_module             modules/mod_dav.so
LoadModule  dav_svn_module         modules/mod_dav_svn.so
LoadModule  authz_svn_module       modules/mod_authz_svn.so

3. Creating the Project repository locations.
Create a Repository Folder where you want to store all the projects. For example I am creating folders called DFRepository and SFRepository in my E drive.

E:\Repositories\DFRepository
E:\Repositories\SFRepository

These are just directories to hold our repositories, now we must create the repositories themselves, using the svnadmin utility

 

Then Subversion will create a folder predifined structure inside this repository folder.

4. Creating the Users authentication file
               We can create a folder called etc in the root location where we had installed Subversion and Apache server. Open the command promt and just go to the bin directory of Apache Server and run the following commands.

htpasswd -cm D:\Subversion\svn-auth-file usernameOne
New password: *****
Re-type new password: *****
Adding password for user usernameOne

htpasswd -m D:\Subversion\svn-auth-file usernameTwo
New password: *****
Re-type new password: *****
Adding password for user usernameTwo

When using the command for the first time, add the -c option. This creates the file named D:\Subversion\svn-auth-file . The -m option instructs the htpasswd utility to use MD5 algorithm to encrypt the passwords.

5. Creating the Access – rights file 
Create a file called svn-acl in the etc folder and add the following content into it. You can modify this content as per your need.

# specifinh groups here
[groups]
DFTeam = name1, name2

# DFTeam group has a read/write access to ‘DFRepository’ repository
# all subdirectories; all others have read access only
[DFRepository:/]
@DFTeam = rw
* = r

# ‘SFRepository’ repository, only harry and sally have read-write access.
[SFRepository:/]
harry = rw
sally = rw
* = r

# ross is helping with the time zone part of the project2
[SFRepository:/timezone]
harry = rw
sally = rw
ross = rw
* = r

6. Creating the SVN Location module

Create another file called Subversion.conf in the same etc folder which contains the following data.

<Location /DFRepos>
  DAV svn
  SVNPath E:\Repositories\DFRepository

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

  Require valid-user
  AuthzSVNAccessFile c:/etc/svn-acl
</Location>

<Location /SFRepos>
  DAV svn
  SVNPath E:\Repositories\SFRepository
  AuthType Basic
  AuthName "Subversion Project2 repository"
  AuthUserFile c:/etc/svn-auth-file

  Require valid-user
  AuthzSVNAccessFile c:/etc/svn-acl
</Location>
 

If u dont want to include the access defenitions file and just want to check the user is valid or not the just change the Subversion.conf as follows.

<Location /SFRepos>
  DAV svn
  SVNPath E:\Repositories\SFRepository
  AuthType Basic
  AuthName "Subversion Project2 repository"
  AuthUserFile c:/etc/svn-auth-file

  <LimitExcept GET PROPFIND OPTIONS REPORT>  Require valid-user  </LimitExcept>
       </Location>

7. Configuring Location in httpd.conf file

This is very simple step. Just add this Subversion.conf file to the end of httpd.conf file as follows

Include D:\Subversion\etc\subversion.conf

Restart the Apache Server :) . Finished…

Reference: This link helped me a lot to configure the repository

7 Responses to “Installing Subversion? Just follow this 7 Steps”


  1. 1 beltran March 26, 2008 at 5:34 pm

    Good post. Have you tried BitNami Subversion Stack http://bitnami.org/stack/subversion? You can save some steps :)

  2. 2 Bob Yexley March 26, 2008 at 6:30 pm

    Or, you could just install VisualSVN Server [0]. :) Great article though. This is great information to have available when you’re in a bind and can’t remember the exact syntax for configuring Apache.

    [0]: http://www.visualsvn.com/server/

  3. 3 RareButSerious March 26, 2008 at 6:30 pm

    I would also recommend SVN1ClickSetup, which does everything in a wizard-like fashion and eliminates a *lot* of dependencies:

    http://svn1clicksetup.tigris.org/

    I had a remotely-accessible subversion server up and running about 15 minutes after discovering this.

  4. 4 Ryan June 4, 2008 at 10:00 pm

    You have -cm in both the steps on the user creation. The second one should just be -m otherwise you overwrite the user you just created.

  5. 5 Lijin January 6, 2009 at 5:49 pm

    Ryan, You are right! I changed it. Thanks a lot.


  1. 1 double density design - Bookmarking the web - w13/2008 Trackback on March 30, 2008 at 11:26 am
  2. 2 Configuring "Cruise Control" with "Maven2" and "SVN 1.4.6" for continuous build environment « Lijin’s Localhost Trackback on April 29, 2008 at 2:41 pm

Leave a Reply




Disclaimer

The information on this site is for informational purposes only. The use of any Trademark or Copyrighted material is not intended to infringe Copyright. This blog is intended to be used under a policy of personal and non commercial use.

Subscribe it

Subscribe

Blog Stats

  • 283,480 hits

Twitting

Adds

Add to Technorati Favorites
Subscribe in NewsGator Online Subscribe in Bloglines
 Add to My AOL
Subscribe in FeedLoungeAdd to netvibes
Add to The Free Dictionary
Subscribe in NewsAlloyAdd to Pageflakes

Feeds

RSS Daily Bible Verse

  • Matthew 24:35

 

March 2008
S M T W T F S
« Feb   Apr »
 1
2345678
9101112131415
16171819202122
23242526272829
3031