Share

 

Free Apache Subversion® Server Installation Guide

Download Links and Tutorials for Subversion Servers

Subversion Hosting at Assembla

Assembla provides the world's best subversion hosting in the the cloud. Our secure, reliable, and feature-rich subversion hosting is FREE and scalable with integrated task and issue management, social collaboration, and project management tools.


LinuxInstall Subversion Server On Linux from Binaries

There are many "flavors" of Unix/Linux available today, and for each individual distribution, there are several different ways to get up and running with your own Subversion Server. We've compiled a list of the top 10 Linux Distributions, along with the appropriate commands and download locations to install the Subversion binaries from either the native package manager for that distribution, or by downloading a set of binary files. To get started, simply choose an install method for you distribution below:

1. Subversion Server Install Commands and Downloads by Distribution

Grab and install the Subversion Server binaries for your Linux distribution using the table below. Once you're finished, continue onward to
Step 2.

Linux Distribution Package Manager Command Download Links & Compile Guides

IBM AIX

N/A

Download Binaries From:
CollabNet (Certified Binaries)

 

&
Debian or Ubuntu

> apt-get install subversion

(Ubuntu users prefix apt-get with 'sudo ' )

Install Guide:
Compile and Install Subversion from Source
(Verified to work for SVN 1.6.6 on Ubuntu 8.04, 9.04 and Debian 5.0)

&
Fedora or CentOS

> yum install subversion

Install Guide:
Installing SVN on Fedora

Install SVN + Mod_DAV_SVN on CentOS


FreeBSD

No Package Manager. Simply:

> cd /usr/ports/devel/subversion;

> make install

Install Guide:

How to Install Subversion 1.6.6 on FreeBSD 7.2


HP-UX

N/A

Download Binaries from:
HP Porting Centre

 

Install Guide:
N/A


NetBSD

No Package Manager. Simply:

> cd /usr/pkgsrc/devel/subversion;

> make install clean

Install Guide:

How to Install Subversion 1.6.6 on FreeBSD 7.2


OpenBSD

> sudo pkg_add subversion

Install Guide:

How to Install Subversion 1.6.6 on FreeBSD 7.2


OpenSUSE

Via Zypper:

> zypper install subversion

 

Via YaST:

> yast2 -i subversion

Install Guide:

Setting up Subversion using Apache2


OpenSolaris

Via pkg-get:
> pkg-get install subversion

Install Guide:

N/A

2. Create and Configure your first Subversion Repository

Now that you've finished installing Subversion, let's get that first repository up and running! So go ahead and warm up your terminal... :-)

First let's create a location to store all of our repositories: (replace <username> with your user account name)

> mkdir -p /home/<username>/svn/repository

You can put them anywhere you like, we just chose this as a suitable default location.

Now we'll use the Subversion administration tool, svnadmin, to create our first repository. For this Tutorial, we'll call our first project aptly titled "myfirstproject:"

> cd /home/<username>/svn/repository

> svnadmin create myfirstproject

Great! Now that we've created our first repository, we need to configure the permissions for who can access the repository. To do that we'll need to edit the configuration file "svnserve.conf" located in your project's "conf" directory. Open "/home/<username>/svn/repository/myfirstproject/conf/svnserve.conf" in your favorite text editor.

When you open this file, you'll see a heavily ### commented file. The lines with the single "#" comment marks are the ones we need to edit. You'll want to remove the comments (#) and customize these settings to suit your project's needs. Here are what the main directives in this file mean:

  • password-db - this is the name of a text file that stores the usernames and passwords of authorized users for your repository. Unless otherwise specified, it will be assumed that this file is stored in your projects "conf" directory. When you create your repository a "passwd" file is created by default. You may want to change this to something a little more cryptic. If you would like to set up a single password file that would work with multiple repositories, you may wish to store this password file elsewhere, and use an absolue path such as /Library/Subversion/Users/passwd-db
  • realm - realm tells clients what they are connecting to. It's recommended you customize this to something like "<Project Name> Subversion Repository." But you can of course choose any name you wish.
  • anon-access - this directive indicates what anonymous users are allowed to do with your repository. The three valid values are none, read, and write. As you would expect, none allows anonymous users to neither read nor write to your repository; read grants read-only access, and write (not recommended) allows for both read and write permissions.
  • auth-access - determines what permission level authorized users will have. In almost every case this will be set to write. Again, the three valid options are none, read, and write.

At the bottom of this conf file, you may also see the option to use SASL to handle security and authorization for your Server. We're going to leave that commented out, but if you want to explore a more secure alternative, you can find out more about configuring Subversion Server to work with SASL in the SVN Book, which is available from the Collabnet folder from your Start Menu or on the SVN Book website here: Using svnserve with SASL.

Once you've saved your customized svnserve.conf, you'll need to open or create your password-db file. In this example we've just used the included passwd file located in the conf directory. Open that file, and you'll see something like the following:

[users]
# harry = harryssecret
# sally = sallyssecret

Using the same format, you can add as many users to your repository(s) as you want in this file. Add at least one user for yourself so that you can begin committing to your repository, and save the file.

Next we'll need to change the permissions on the Repository directory so that svnserve is permitted to make changes to the files stored there:

> sudo chown -R root:admin /home/<username>/svn/repository

> sudo chmod -R ug+rwX,o= /home/<username>/svn/repository

After you've done that, it's time to fire up the svnserve Subversion Server daemon:

> svnserve -d -r /home/<username>/svn/repository

3. Testing Your Subversion Server Configuration

Now we're ready to make sure that we can check out a working copy and work with it. We're going to use the command-line svn client to handle the Subversion client-side tasks. If you don't already have a Graphical Subversion Client installed, be sure to check out our Linux Subversion Clients Guide.

Let's create a directory called projects in our home directory to hold the working copies of our SVN Projects, and then issue the commands to check out a working copy of the project we created in the previous step:

> cd ~

> mkdir projects

> cd projects

> svn checkout svn://localhost/myfirstproject

If you set read permissions to authorized users only, you'll be prompted to enter your username and password. After you've successfully checked out a working copy, we'll add a default project layout and a test file before we make our first commit.

> cd myfirstproject

> svn mkdir branches tags trunk

> touch trunk/test.txt

> svn add trunk/test.txt

Now we're ready to commit our first revision to our repository:

> svn commit -m "Initial Import"

Because we're inside of the my project directory we don't need specify the url to the repository. If you have specified in your svnserve.conf file that only authorized users can make commits, then you'll be prompted again for your username and password.

If your commit was successful, you should see some output like this:

Adding branches
Adding tags
Adding trunk

Adding trunk/test.txt

Committed revision 1.

Now you've successfully installed, configured, and worked with your first project hosted on your own Subversion Server.

4. Additional Resources

Free Linux Subversion Client Guide

Need a Graphical Subversion Client for your Mac development machine? We've reviewed some of the most popular mac client's in our Subversion Client Guide.

The Subversion Book

"Version control with Subversion" published by O'Reilly, is the go-to manual for all things subversion, and you can view it online or as a pdf. (If you used any of the installers above, you'll find the manual available from your start menu as a pdf or chm). If you have more advanced configuration needs, or just want to get more familiar with Subversion... RTFM! :-)

Official Subversion Website

Join the subversion project, checkout the latest nightly build from source, file a bug report, or just learn more about the project here.