Installing and adjusting SVNSERVE

Author: Eugeniy Marilev
Date of publication: 2014-05-06 10:41:12

As practice shows, the server svnserve is the most flexible way to manage remote repositories. Flexibility exists here due to the server has a whole bunch of settings, if you cleverly vary of them you can achieve the desired results.

Install svnserve:

sudo apt-get install subversion

To create a repository, use the following utility kernel svn - «svnadmin». Let's create a repository with the name «test»:

sudo mkdir /var/spool/svn
sudo svnadmin create /var/spool/svn/test

And, for the sake of simplicity, for now let's configure the basic rights of access for users of the service. To do this let's edit the configuration file repository:

sudo nano /var/spool/svn/test/svnserve.conf
Has to turn up something like this:
# Path to the file with users and passwords
password-db = /var/spool/svn/test/conf/passwd
# Authentication Realm of repository, two repositories with single users and passwords database must have single realm.
realm = My-test-repository
# Deny access for anonymous users.
anon-access = none
# Grand all authenticated users with read and write permissions
auth-access = write
Let's open the file of users and passwords:
sudo nano /var/spool/svn/test/conf/passwd
The file has following structure:
user1 = password1
user2 = password2

As a result of the installation of subversion, we have a working system of version control, one of the supporting tools, which is «svnserve». Let's just say that it's quite multifunctional script that will allow us to start the svn server as a daemon. To do this, we need to start it with the following keys:

sudo svnserve -d --listen-host -r /var/spool/svn

"d" — in deamon regime.

"r" — rout to the root of depository.

—listen-host — ip the address of the socket on which the server will listen for incoming connections.

To be sure that the server will be available after the reboot of the computer, you need to add it to crontab:

crontab -e
Let's add the following line in the end of cron scenario:
@reboot svnserve -d --listen-host -r /var/spool/svn

That's enough for the beginning. Svnserve allows you to group up users, and assign a user different access rights, even on the level of individual folders and repository files. Read more about fine-tuning access to svnserve here.

Well, now you can test if the server is:

svn co svn:// ~/test
cd ~/test
echo "foo bar" > test-file
svn add test-file
svn remove test-file
svn commit
Article comments
Приветствую. Подскажите если не трудно, откуда информация? Более полного я еще не встречал. Мне пригодилось.
Много опыта работы с этим серверов - вот ответ. Подробность и лаконичность изложения прививается со временем любому IT-специалисту)
Уважаемый, у Вас оказывается есть ещё одно качество - Вы очень скромны!
Eugeniy Marilev
Only logged users can leave comments.