Set up a Subversion repository

Overview

This article explains how to configure a Subversion repository.

Prerequisites

These steps assume you're setting up your SVN repository on your DreamHost server. View the SSH overview article for instructions on logging in to your server.

Setting up a repository

The following steps explain how to set up a repository.

This example uses the repository name my_project, and the repository location is in the /home/username/svn/ directory.

Initialize the repository

It is recommended to keep all of your repositories within a dedicated folder in your user's home directory.

  1. Navigate to your home directory:

    [server]$ cd ~
  2. Create the svn directory:

    [server]$ mkdir svn
  3. Use the svnadmin command to initialize your project:

    [server]$ svnadmin create ~/svn/my_project

Configure access and security

Edit your repository's configuration files to manage users and permissions.

  1. Navigate to the config directory:

    [server]$ cd ~/svn/my_project/conf
  2. Use a text editor like nano to add your users:

    [server]$ nano passwd
  3. Add your usernames and passwords under the [users] section in the following format before saving:

    username = your_password
  4. Edit the svnserve.conf file to set your privacy rules and enable authentication:

    [server]$ nano svnserve.conf
  5. Uncomment the following lines (remove the # at the beginning of the line) and save the file:

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

Connect to your project

The most secure and efficient way to connect to your manual setup is via SVN+SSH. This method uses your existing DreamHost SFTP/SSH credentials to establish a secure tunnel.

Your Repository URL will look something like this: 

svn+ssh://your-ssh-user@yourdomain.com/home/your-ssh-user/svn/my_project

Make sure you have the correct SSH user, domain name, and the absolute path to your project before attempting to connect. You can then use this as your "URL of Repository" in your favorite client, or checkout your project via:

[local]$ svn checkout svn+ssh://username@example.com/home/username/svn/my_project

See also

 

Did this article answer your questions?

Still not finding what you're looking for?