Setup Subversion on a Red Hat based system

As a follow up to one of my previous posts I thought I should just write a little guide on how to setup Subversion on a Red Hat based system like Cent OS, Fedora, and of course Red Hat it self. This is the way I like to install subversion, it uses svnserve and xinetd, which means it starts on demand. When you make a call with e.g subversive in Eclipse towards your server, xinetd kicks in and starts svnserve to serve your request.


First we have to install the packages for subversion and xinetd.

# yum install subversion xinetd

Then we create a user for subversion, make a directory for it to work in, and give it ownership to that directory. This is done with the following commands:

# adduser -r -M -d /var/svn svn
 (-r creates a system account, -M the user home direcory will not be created, 
-d specifies user's login directory)

# mkdir /var/svn

# chown -R svn:svn /var/svn/

Now change to the svn user, and we can create the repository

# su - svn
# svnadmin create /var/svn/repos

In your newly created repository there now a conf directory with a few files to modify. These are svnserve.conf and passwd. Change them to set the access rights of your repository.

Here is my svnserve.conf:

[general]

### These options control access to the repository for unauthenticated

### and authenticated users.† Valid values are “write”, “read”,

### and “none”.† The sample settings below are the defaults.

anon-access = none

auth-access = write

### The password-db option controls the location of the password

### database file.† Unless you specify a path starting with a /,

### the file’s location is relative to the conf directory.

### Uncomment the line below to use the default password file.

password-db = passwd

### The authz-db option controls the location of the authorization

### rules for path-based access control.† Unless you specify a path

### starting with a /, the file’s location is relative to the conf

### directory.† If you don’t specify an authz-db, no path-based access

### control is done.

### Uncomment the line below to use the default authorization file.

# authz-db = authz

### This option specifies the authentication realm of the repository.

### If two repositories have the same authentication realm, they should

### have the same password database, and vice versa.† The default realm

### is repository’s uuid.

# realm = My First Repository

And my passwd file:

[users]

hersson = mypassword

The last thing we have to do is to configure the svnserve for xinetd.

vi /etc/xinetd.d/svnserve

Paste the following:

service svn
{
 port = 3690
 socket_type = stream
 protocol = tcp
 wait = no
 user = svn
 server = /usr/bin/svnserve
 server_args = -i -r /var/svn
 }

Now restart the xinetd service and you’re all done.

# /etc/init.d/xinetd restart

Connect to your repository with the following url

svn://<username>@yourserver/repos

To checkout my reposistory I would write the following:

# svn co svn://hersson@localhost/repos
  • Twitter
  • Facebook
  • del.icio.us
  • Digg
  • Google Bookmarks
  • StumbleUpon
  • FriendFeed

Leave a Reply

Your email address will not be published. Required fields are marked *


1 × seven =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>