Monday, 29 July 2013

Setup SVN And Access Through SVN Protocol on Debian Wheezy


Installing Subversion

Subversion can be installed as follows:

apt-get install subversion


Next we create a directory that will hold our repository/repositories - I use /var/lib/svn, but you can use another directory, if you like.

mkdir -p /var/lib/svn

I want to create a repository for my software project called myproject inside the /var/lib/svn directory  this can be done as follows:

svnadmin create /var/lib/svn/myproject

Using The svn:// Protocol


We can use the svn:// protocol by starting the svnserve daemon.
Before we do this, let's configure password protection for our repository. There's a conf/svnserve.conf file in each repository, so for /var/lib/svn/myproject it's/var/lib/svn/myproject/conf/svnserve.conf. open that file...

vim /var/lib/svn/myproject/conf/svnserve.conf
Then add the following entries to /var/lib/svn/myproject/conf/svnserve.conf file:

anon-access = none
auth-access = write
password-db = passwd
realm = My SVN Repository

Now add an svn user by adding following entry to /var/lib/svn/myproject/conf/svnserve.conf file:
amit = amitpw

Now time to start the SVN Serve Daemon:
svnserve -d -r /var/lib/svn
(The -d switch makes it run as a daemon in the background.)
Run 
netstat -tap | grep svn
tcp        0      0 *:svn             *:*                     LISTEN      12766/svnserve


Now we can use the svn:// protocol. For example, a checkout can be done as follows:

svn co --username amit svn://192.168.0.100/myproject /home/amit/somedir

 Using The svn+ssh:// Protocol



To tunnel the svn:// protocol through SSH, just follow chapter 6 and make sure you have an SSH damon running on your Debian system (if you have not, you can install it by running:

apt-get install openssh-server ssh

That's it! All you have to do now is to use svn+ssh:// instead of svn://, for example, a checkout can be done as follows:

svn co --username amit svn+ssh://192.168.0.100/var/lib/svn/myproject /home/falko/somedir



No comments:

Post a Comment