How to Install and Configure SVN Server on Debian Linux Systems

undefined

Subversion is an product of Apache Software Foundation. It is open-source revision control system, which is designed to be a replacement for CVS. This article will help you install and configure SVN Server on Ubuntu & LinuxMint operating system.

1. Install Required Packages

First install required packages for Subversion server on your system.

$ sudo apt-get update
$ sudo apt-get install subversion subversion-tools libapache2-svn

2. Configure Apache Module

Now enable Dav svn module in Apache2 server using following command.

$ sudo a2enmod dav_svn

Now create main svn directory on your svn server.

$ sudo mkdir /var/svn

Lets edit Apache dav_svn module configuration file and add following settings at end of file.

$ sudo vim /etc/apache2/mods-available/dav_svn.conf
<Location /svn>
  DAV svn
  SVNParentPath /var/svn
</Location>

After making above changes, restart Apache service.

$ sudo service apache2 restart

3. Create Your First Repository

Create your first svn repository named firstrepo, You can use any suitable name.

$ cd /var/svn
$ sudo svnadmin create firstrepo

Now create a directory and create skeleton directories for your first repository.

$ mkdir ~/mainrepo
$ cd ~/mainrepo
$ mkdir trunk tags branches

Import skeleton directory to your first repository.

$ sudo svn import ~/mainrepo file:///var/svn/firstrepo -m 'Adding Initial Directories'

Adding         /root/mainrepo/tags
Adding         /root/mainrepo/trunk
Adding         /root/mainrepo/branches

Committed revision 1.

4. Setup Apache for First Repository

Now edit dav_svn apache module configuration file and add your first repository settings.

$ sudo vim /etc/apache2/mods-available/dav_svn.conf
<Location /svn/firstrepo >
  AuthType Basic
  AuthName "Authorized Access Only"
  AuthUserFile /etc/apache2/dav_svn.passwd
  Require valid-user admin
</Location>

Now add user in password file for authentication of svn repositories.

$ sudo htpasswd /etc/apache2/dav_svn.passwd admin

Let’s restart Apache service again.

$ sudo service apache2 restart

undefined

5. Checkout Repository

At this point you have successfully created svn repository for your first project. Let’s checkout your project to your working directory.

$ svn co http://127.0.0.1/svn/firstrepo ~/firstrepo 

Authentication realm:  Authorized Access Only
Password for 'root': [Just Press Enter]
Authentication realm:  Authorized Access Only
Username: admin
Password for 'admin': *******

Store password unencrypted (yes/no)? yes
A    /root/firstrepo/tags
A    /root/firstrepo/trunk
A    /root/firstrepo/branches
Checked out revision 1.

If You Appreciate What We Do Here On Mimastech, You Should Consider:

  1. Stay Connected to: Facebook | Twitter | Google+
  2. Support us via PayPal Donation
  3. Subscribe to our email newsletters.
  4. Tell other sysadmins / friends about Us - Share and Like our posts and services

We are thankful for your never ending support.

Leave a Reply

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