Trip and Tick: svnserve on linux et al
I spotted this handy blog entry and so decided to give it a go, on a brand new $15 linux VDS. Here are my notes, which are consequently a rehash of that blog.
Let's decide that svnserve will run as user svn, and access repositories off its home
directory ie. /home/svn.
So we create the user svn with useradd, which creates its home directory /home/svn.
We create repository using svnadmin eg. /home/svn/aptframework.
If this host is aptframework.net, then this repository's URL
will be svn://aptframework.net/aptframework.
In the svnserve.conf for our repository, we uncomment as follows.
We might want to have anon-access set to none eg. for private stuff.
In the specified passwd-db file,
we add usernames and passwords for ourselves.
If we want to use a common password file for multiple repositories eg. /home/svn/passwd, then...
where we specify the absolute path for password-db in svnserve.conf.
We add an svn config for xinetd in subdirectory /etc/xinetd.d/ as follows
where svnserve runs as user svn, and serves repositories off /home/svn.
We restart xinetd for the changes to take effect.
Now we can checkout a "working copy" of repository using svn://aptframework.net/aptframework URL.
Let's add and commit the standard (although optional) directories trunk, branches and
tags.
Finally we can import our source as follows, eg. from
/projects/aptframework/src.
Or for the whole shebang, eg. src, lib and what-have-you...
We can do a test checkout to a tmp directory to make sure it looks ok, eg.
we checkout just the src directory as follows.
When things don't go as planned, we just recreate the repository from scratch as follows.
To re-import source, we'll need to search and destroy all those .svn hidden directories
eg. in our src, innit.
Setting up and serving a subversion repository is quite trivial.
We create an svn user, configure svnserve in xinetd, and
use svnadmin to create repositories.
useradd svn
# useradd svn
svnadmin create
# useradd svn
# su - svn
$ svnadmin create aptframework
vi svnserve.conf
$ vi /home/svn/aptframework/conf/svnserve.conf
anon-access = read
auth-access = write
password-db = passwd
$ vi /home/svn/aptframework/conf/passwd
evanx = sshssh
$ mv /home/svn/aptframework/conf/passwd /home/svn/passwd
$ vi /home/svn/aptframework/conf/svnserve.conf
password-db = /home/svn/passwd
xinetd
# vi /etc/xinetd.d/svn
service svn {
port = 3690
socket_type = stream
protocol = tcp
wait = no
user = svn
server = /usr/bin/svnserve
server_args = -i -r /home/svn
}
# /etc/init.d/xinetd restart
svn checkout
# cd /tmp
# svn co svn://aptframework.net/aptframework aptframework --username evanx
# cd aptframework
# mkdir trunk
# mkdir branches
# mkdir tags
# svn add trunk
# svn add branches
# svn add tags
# svn commit -m "" --username evan
svn import
# cd /projects/aptframework
# svn import src svn://aptframework.net/aptframework/trunk/src -m "" --username evanx
# cd /projects
# svn import aptframework svn://aptframework.net/aptframework/trunk -m "" --username evanx
# svn co svn://aptframework.net/aptframework/trunk/src /tmp/aptframework-src --username evanx
And again
# su - svn
$ rm -rf aptframework
$ svnadmin create aptframework
$ vi aptframework/conf/svnserve.conf
$ vi aptframework/conf/passwd
Conclusion





