1. root登陆centos, 执行命令:
yum install subversion
安装完成。
2. 创建svn版本库目录:
mkdir /root/.svnrepos/my-repos
svnadmin create --fs-type fsfs /root/.svnrepos/my-repos/
3. 配置权限:注意每行前面不能有空格:
/root/.svnrepos/my-repos/conf/authz 文件参考:
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
[groups]
admin = andy
# harry_sally_and_joe = harry,sally,&joe
# [/foo/bar]
# harry = rw
# &joe = r
# * =
[/]
@admin = rw
/root/.svnrepos/my-repos/conf/passwd 文件参考:
[users]
andy = 123456
/root/.svnrepos/my-repos/conf/svnserve.conf 文件,打开如下行(每行前面不能有空格):
auth-access = write
authz-db = authz
password-db = passwd
4. 在后台运行svn, (需要要指定配置文件的位置):
/usr/bin/svnserve -d --listen-port 3690 -r /root/.svnrepos/my-repos/ --log-file /var/log/svn.log --pid-file /var/log/svn.pid --listen-host 192.168.1.17 --config-file /root/.svnrepos/my-repos/conf/svnserve.conf