Blog Archive

Tuesday, December 8, 2009

How to install subversion (SVN) and create users

Consider "TIMS" as repository
  • Online howto available at http://svnbook.red-bean.com/en/1.5/svn-book.html
  • apt-get install subversion (install svn repositary)
  • "svn init script" to automatically start svn at boot time (Note: this script needs to be added separately later)
  • The location of subversion repositories is /opt/svnrepos/
  • For example, for TIMS repository, go to the TIMS project svn directory /opt/svnrepos/TIMS/conf/
  • And configure the file /opt/svnrepos/TIMS/conf/svnserve.conf first
  • An example of svnserve.conf file
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
realm = TIMS Repository
  • To create a user, edit the files authz and passwd located at /opt/svnrepos/TIMS/conf in the correct format to create a user and assign password respectively
  • To create a repository, issue the command "svnadmin create /opt/svnrepos/<project-name>"
  • For example, to access the TIMS repository from the clients, the following command should be run on the terminal:
svn co svn://192.168.10.11/TIMS TIMS

Here is a "svn init script"

#! /bin/sh
# /etc/init.d/svnserve

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/svnserve
NAME=svnserve
DESC="SVN Repository Server Daemon"
test -x $DAEMON || exit 0
OPTIONS="-d -r /opt/svnrepos"
# Get lsb functions
#. /lib/lsb/init-functions
. /etc/default/rcS
start() {
echo "Starting $DESC... "
# echo "Starting $DESC: "
if ! start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $OPTIONS
>/dev/null 2>&1; then
status=$?
echo $status
return $status
fi
log_end_msg 0
return 0
}
case "$1" in
start)
start
;;
stop)
echo "Stopping $DESC: "
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
echo $?
;;
restart|force-reload)
$0 stop
sleep 1
start
#echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0

To Start SVN automatically at start up;refer this BLOG
 

0 comments:

Post a Comment

Followers