Archive for the ‘svn’ Category

Install, configure and run SVN server on Linux

This note is about how to install, configure and run SVN (Subversion) server on Linux. In my case, it’s Debian.

The requirements:

  • Use svnserve, so access repositories via svn:// protocol.
  • Install, configure and run SVN server as fast as possible.

Install SVN (Subversion) server

    sudo apt-get install subversion

Create the folder for repositories

In this example repositories are located in /var/spool/svn/, you may choose the another folder.

    sudo mkdir /var/spool/svn

Create the first repository

In the code below, the new repository is created in the test folder.

    sudo svnadmin create /var/spool/svn/test

Configure access

Find /var/spool/svn/test/conf/svnserve.conf and check that password-db, anon-access and auth-access are uncommented and have the following values:

    password-db = passwd
    anon-access = none
    auth-access = write

Set users passwords in repository’s passwd file:

    [users]
    user1 = passwordforuser1
    user2 = passwordforuser2
    user3 = passwordforuser3

Start SVN server with help of svnserve

    svnserve -d -r /var/spool/svn

Possible problems:

1. If you cannot checkout and get the error, use the correct path.

    user@server:~$ svn co svn://server.url/var/spool/svn/test ~/test

svn: No repository found in ‘svn://server.url/var/spool/svn/test’

Incorrect repository path. It should be:

    user@server:~$ svn co svn://server.url/test ~/test

2. If you get an access error check the repository access configuration.

    user@server:~$ svn co svn://server.url/test ~/test --username user1 --password 123456

svn: No access allowed to this repository

No access to this repository. Check that password-db is uncommented in svnserve.conf and auth-access has the value of write:

    password-db = passwd
    auth-access = write

Also check that you have the user password configuration in passwd file of the repository.

Remote backup and restore SVN repository

Backup:

    sudo svnrdump http://some.url/some-repository > backup.dump

Restore:

    sudo svnadmin load repository_name < ~/backup.dump

Useful links

Subversion

Setting Up an Ubuntu Subversion Server