Setting up SVN server and RapidSVN client for Debian
Written by Petar Jercic   

SVN repository set up on the server, set up Apache to access repositories and set RapidSVN client with whom we perform the operation on repositories. Each step will be listed and explained later. Instructions are given with the help of these sites:

SVN Setup on Debian http://www.howtoforge.com/debian_subversion_websvn
RapidSVN documentation http://www.rapidsvn.org/index.php/Documentation

Do not use these links to install it as we will list all the steps here, unless you want to go into more detail in setting up or set up a custom solution, then use the above links.

In short, it is necessary to install libs, create a repository structure, adjust the rights and configure Apache and RapidSVN. To perform these actions you need to be logged in as root

0. Preparing for installation

Remove old and unused libs

apt-get autoremove
apt-get update
Install libs needed to set up SVN (note that SSH and Apache must be installed and functional, if not, first deal with their installation and configuration)

apt-get install subversion
apt-get install libapache2-svn 

1. Setting up SVN repositories

We must create the folder that contains SVN repository of all the projects that we do, afterwards we have to set this folder rights for Apache and for all its users.

mkdir /var/svn-repos/
svnadmin create --fs-type fsfs /var/svn-repos/project_zen
svnadmin create --fs-type fsfs /var/svn-repos/project_wombat
All users are listed in the group users and we'll provide rights for this group, www-data is Apache's username.

chown -R www-data:users /var/svn-repos/*
chmod -R 770 /var/svn-repos/* 

2. Checking whether Apache mod is working

Normally the Apache mod starts automatically, so just check whether SVN mod for Apache is working

a2enmod dav
a2enmod dav_svn 

3. Creating Apache SVN users

Create users for the Apache SVN mode, ie users who can access the repository. On request you can leave the password blank so that your client doesn't ask you Password each time you want to access the repository.

htpasswd2 -c /etc/apache2/dav_svn.passwd you
htpasswd2 /etc/apache2/dav_svn.passwd pjercic
htpasswd2 /etc/apache2/dav_svn.passwd dkrst

4. Setting Apache to work with repositories

Now we need to state where are the repositories on the disk for Apache, so as we enter the information in /etc/apache2/mods-available/dav_svn.conf

<Location /svn_zen>
	DAV svn
	SVNPath /var/svn-repos/project_zen
	AuthType Basic
	AuthName "Subversion Repository"
	AuthUserFile /etc/apache2/dav_svn.passwd
	Require valid-user
	#SSLRequireSSL
</Location>

<Location /svn_wombat>
	DAV svn
	SVNPath /var/svn-repos/project_wombat
	AuthType Basic
	AuthName "Subversion Repository"
	AuthUserFile /etc/apache2/dav_svn.passwd
	Require valid-user
	#SSLRequireSSL
</Location>
You can uncomment SSLRequireSSL if you want to use HTTPS rather than HTTP protocol.

SSLRequireSSL
After we reset Apache the browser can display a repository http://192.168.0.40/svn_wombat/

/etc/init.d/apache2 restart

5. Installing RapidSVN and necessary libs

Install RapidSVN, KDiff3 and Meld library. If you use Gnome install kdiff3-qt, and if you use KDE then instal kdiff3

apt-get install rapidsvn

apt-get install kdiff3
- or -
apt-get install kdiff3-qt

apt-get install meld

6. Configuring RapidSVN

Under the View > Preferences set up to the desired Editor, navigation on the Gnome to nautilus or KDE konqueror, Difference to Meld and Merge to kdiff3. For other details of using this tool, read the documentation RapidSVN http://www.rapidsvn.org/index.php/Documentation That's it!

7. Setting up Subclipse for Eclipse

Since I had to use Subclipse with Eclipse I decided to give a few tips here, nothing too big but it might spare you from some problems.

After installation update Eclipse Help > Software Updates > Find and Install select Search For New Features and then select the first listed site and accept all the libraries that want to be installed installed.
After that try to install Subclipse using the standard way specified here [http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA].

If this fails, download zip, unzip it and point to it with the New Local Site button, expand installation tree, turn off libs which are in conflict (Myelom and some camp) and continue the installation.

Useful links for using Subclipse
http://www.ibm.com/developerworks/opensource/library/os-ecl-subversion/
http://ist.berkeley.edu/as-ag/tools/usage/subclipse-usage-tips.html
http://agile.csc.ncsu.edu/SEMaterials/tutorials/subclipse/

Comments (0)