Svn 配置实例

1,配置文件

1> svnserve.conf

[general]
anon-access = read
auth-access = write

password-db = passwd

authz-db = authz

2> passwd

[users]
# harry = harryssecret
# sally = sallyssecret
cgjc = chjc
gol = gol

3> authz

[groups]
svn = cgjc, gal

[/]
@svn = rw

[/phonedev]
@svn = rw

2,启动svn服务

[root@inspiron545svr ~]# svnserve -d -r /svn/phonedev
[root@inspiron545svr ~]# cd svn
[root@inspiron545svr svn]# svnadmin create phonedev

导入project,比如demo
svn import /root/demo file:///svn/phonedev/demo -m "init"
之后就可以用 svn://192.168.0.98/demo 来获取demo这个project了

3, 在netbeans里面配置svn

团队开发 -> Subversion -> 签出

资源库URL:  svn://192.168.0.98/demo
username: ********
password: *******

错误:
svn: 条目不可读,在 svnserve.conf 文件中,把 anon-access 彻底关闭就可以了,办法是加上这么一行:anon-access = none
设置启动方式

svn服务器配置好了以后,由于svnserve本身没有Start,stop,为了方便运行,可以自己写一个启动脚本

脚本如下 命名为svn:

vim /etc/rc.d/init.d/svn

#!/bin/bash
# chkconfig: 35 70 30
# description: It is used to serve
SVN_HOME=/usr/bin
if [ ! -f "$SVN_HOME/svnserve" ]
then
echo "svnserver startup: cannot start"
exit
fi
case "$1" in
'start')
echo "Starting svnserve..."
$SVN_HOME/svnserve -d -r /svn/phonedev
echo "Finished!"
;;
'stop')
echo "Stoping svnserve..."
killall svnserve
echo "Finished!"
;;
'restart')
$0 stop
$0 start
;;
*)
echo "Usage: svn { start | stop | restart } "
exit 1
esac

然后把该文件放入/etc/rc.d/init.d/目录下面,给这个文件可执行权限:chmod 775 svn
然后执行 chkconfig —add svn
注:# chkconfig: 35 70 30

    description: It is used to serve
    脚本中的这两行是为了支持chkconfig —add svn
    然后就可以通过 service svn start命令进行启动svnserve服务了。

 

你可能感兴趣的:(SVN,职场,休闲)