Sunday, July 8, 2007

KB: Subversion on Ubuntu

Installation and configuration guide for Subversion on Ubuntu Linux.

Contents

Overview

This article assumes that you already have ssh installed on your system.

Install

1. Install Subversion and internet services daemon:
sudo apt-get install subversion xinetd

Configure

1. Create user that will own the repositories:
sudo adduser --system --no-create-home --home /var/svn --group --disabled-login svn
2. Create directory that will hold the repositories:
sudo mkdir /var/svn
sudo chown svn:svn /var/svn
3. Create file /etc/xinetd.d/svnserve with the following content:
service svn
{
  port = 3690
  socket_type = stream
  protocol = tcp
  wait = no
  user = svn
  server = /usr/bin/svnserve
  server_args = -i -r /var/svn
}
4. Restart xinetd:
sudo /etc/init.d/xinetd restart
5. Create the first repository:
sudo -u svn svnadmin create /var/svn/testrepo
chmod -R g+w /var/svn/testrepo/db
6. Add your account to the svn group created earlier.
sudo useradd -G svn krdavis
7. It should be possible to check out the repository and work on it:
svn co svn://localhost/testrepo

SSH

1. In your home dir run the following command (answer the prompts):
ssh-keygen -t rsa
2. In your home dir on the remote machine run:
mkdir .ssh
3. Copy id_rsa.pub to the remote machine as follows:
scp .ssh/id_rsa.pub username@remotemachine.com:.ssh/
4. On the remote machine run the following:
cd .ssh
cat id_rsa.pub > authorized_keys

Connection URL

1. Use the following URL to connect to Subversion:
svn+ssh://krdavis@websvcs.zunisoft.com/var/svn/testrepo
To Top