下载subversion-1.5.0.tar和subversion-deps-1.5.0.tar
# tar xvf subversion-1.5.0.tar
# tar xvf subversion-deps-1.5.0.tar //会解到一个subversion-1.5.0目录下
# cd subversion-1.5.0
# ./configure -prefix=/usr/local/svn
# make
# make install
# mkdir /home/svndata //建立项目的存储库
# vi svn_service
#!/bin/sh
#
# chkconfig: - 91 35
# description: Starts and stops the Subversion service
# subversion options
OPTIONS="-d -r /home/svndata"
prog=_subversion
RETVAL=0
_subversion=/usr/bin/svnserve
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
start() {
KIND="SubVersion"
echo -n $"Starting $KIND services: "
daemon $_subversion $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/subversion || \
RETVAL=1
return $RETVAL
}
stop() {
KIND="SubVersion"
echo -n $"Shutting down $KIND services: "
killproc $_subversion
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/subversion
echo ""
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
status)
status $dc_server
RETVAL=$?
;;
condrestart)
[ -f /var/lock/subsys/subversion ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
exit 1
esac
exit $?
# chmod 755 svn_service
# cp svn_service /etc/rc.d/init.d/svn
# chkconfig --add svn
# chkconfig --level 345 svn on
# netstat -an|grep 3690 //查看svn的端口是否已经开启,没记错的话应该就是3690端口
可以使用绿毛龟(svn客户端)来查看项目情况,使用svn://ip:port/test来查看项目源码
配置
#cd /home/svndata/test/conf
#vi authz
[groups]对组进行配置
# harry_and_sally = harry,sally
# [/foo/bar]按目录进行用户读写配置
# harry = rw
# * =
[repository:/test]对svn库的路径进行配置
# @harry_and_sally = rw
# * = r
radio=rw
pencat=rw
koala=rw
soul=rw
#vi passwd
[users]
# harry = harryssecret
# sally = sallyssecret
radio=123456
都是明文的
#vi svnserv.conf
password-db = passwd将这行的注释去掉,就会要求用户验证
svn换端口
#./svnserve --help 可以看到命令,里面有个参数--listen-port
不过我没有使用过
因为ssl关系出现认证失败的解决办法
1、停掉ssl
2、# authz-db = authz这行的#保留
#去掉#[general]前面的#号
[general]
#匿名访问的权限,可以是read,write,none,默认为read
anon-access = none
#认证用户的权限,可以是read,write,none,默认为write
auth-access = write
#密码数据库的路径,去掉前面的#
password-db = passwd