At the moment I write this document, Subversion is not available in the stable distribution of Debian. Making a backport of Subversion would probably be safer but it's also a considerable task because of the numerous dependencies involved. Considering the purpose of this manual, I will leave this operation as an exercice and proceed with the testing distribution. Backporting Subversion is not in the scope of this manual.
To install Subversion (and its associated and optional tools) :
$ apt-get -t testing -u install subversion subversion-tools
Once Subversion is installed, you have to create a repository. To do that :
$ svnadmin create --fs-type fsfs /var/lib/svn
I chose fsfs as the back-end of my Subversion server. You can also choose bdb if you prefer.
Once the repository is instanciated, as mentioned in the manual of Subversion, we must configure its access editing the file /var/lib/svn/conf/svnserve.conf :
[general] password-db = passwd realm = My realm # anonymous users can only read the repository anon-access = read # authenticated users can both read and write auth-access = write
We will use the built-in authentication and authorization methods provided by Subversion. We must create a password file with the same name used in the previous configuration file, that is, /var/lib/svn/conf/passwd :
[users] fred = fredpwd jean = jeanpwd
The last thing to do to complete the installation of our Subversion repository is to import sources files into it. To do this :
$ svn import myrep file:///var/lib/svn Adding myrep/foo.c Adding myrep/bar.c Adding myrep/subdir Adding myrep/subdir/quux.h Committed revision 1.
That's it! The Subversion repository is all set. To verify if it's working properly, we launch a standalone server and make a simple request :
$ svnserve --daemon --root /var/lib/svn $ svn list svn://localhost myrep/
At this point, we have a running Subversion server. For security reasons, we would like to enclose this server in a jail and make it run under a non-root user with limited privileges.
Let's shutdown our Subversion server and proceed to build its dedicated jail.
$ ps -A | grep svnserve 17579 ? 00:00:00 svnserve $ kill 17579
Running Chrooted SVN on Debian Mini-HOWTO
0.1.0 - February 2005fbergeron@fbergeron.com