|
|
||
Evan Summers's BlogTrip and Tick: svnserve on linux et alPosted by evanx on July 09, 2007 at 11:27 AM | Comments (0)
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.
# useradd svn
We create repository using svnadmin eg. /home/svn/aptframework.
# useradd svn # su - svn $ svnadmin create 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.
$ vi /home/svn/aptframework/conf/svnserve.conf anon-access = read auth-access = write password-db = passwd 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.
$ vi /home/svn/aptframework/conf/passwd evanx = sshssh If we want to use a common password file for multiple repositories eg. /home/svn/passwd, then...
$ mv /home/svn/aptframework/conf/passwd /home/svn/passwd $ vi /home/svn/aptframework/conf/svnserve.conf password-db = /home/svn/passwd 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
# 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
}
where svnserve runs as user svn, and serves repositories off /home/svn. We restart xinetd for the changes to take effect.
# /etc/init.d/xinetd restart
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.
# 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
Finally we can import our source as follows, eg. from /projects/aptframework/src.
# cd /projects/aptframework # svn import src svn://aptframework.net/aptframework/trunk/src -m "" --username evanx Or for the whole shebang, eg. src, lib and what-have-you...
# cd /projects # svn import aptframework svn://aptframework.net/aptframework/trunk -m "" --username evanx 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.
# svn co svn://aptframework.net/aptframework/trunk/src /tmp/aptframework-src --username evanx
When things don't go as planned, we just recreate the repository from scratch as follows.
# su - svn $ rm -rf aptframework $ svnadmin create aptframework $ vi aptframework/conf/svnserve.conf $ vi aptframework/conf/passwd 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.
Bookmark blog post: CommentsComments are listed in date ascending order (oldest first) | Post Comment | ||
|
|