前言
LZ用的是Cenos6.9
查看是否安装
rpm -ql subversion
安装
yum install subversion
查看安装位置
rpm -ql subversion
查看是否安装成功
svnserve --version
创建SVN版本库
mkdir -p /opt/svn/repos/svn1 ##创建目录
svnadmin create /opt/svn/repos/svn1 ##创建SVN版本库
配置版本库
cd /opt/svn/repos/svn1/conf
vim passwd
添加2个用户和密码
[users]
# harry = harryssecret
# sally = sallyssecret
#
lilimin = peng2014
tourist = 123
添加权限
vim authz
[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
admin = lilimin #新建一个admin组,包含lilimin这个用户,指定多个用户用','分隔
user = tourist
[/] #指定根目录下的权限
@admin = rw #admin组有读写权限
* = r #其他组只有读权限
让配置信息生效(打开注释即可)
vim svnserve.conf
[general]
anon-access = read #非授权用户有读权限,如果设置为none则无法访问
auth-access = write #授权用户有写权限
password-db = passwd #密码文件
authz-db = authz #权限文件
启动SVN
svnserve -d -r /opt/svn/repos/
/opt/svn/repos/是版本库的根目录
查看服务是否启动
ps aux | grep svnserve
关闭SVN
[root@iZo5z1am4roz5wZ conf]# ps aux | grep svn
root 16695 0.0 0.2 139132 5184 pts/0 T 17:32 0:00 vim svnserve.conf
root 16704 0.0 0.0 152412 732 ? Ss 17:45 0:00 svnserve -d -r /opt/svn/repos/
root 16752 0.0 0.0 103320 884 pts/0 S+ 18:22 0:00 grep svn
kill -s 9 16704
16704为进程ID
重启SVN
service svnserve restart
访问
由于我用的是阿里云服务器,所以得配置一下安全组规则才能访问3690端口
在TortoiseSVN的url中输入svn://xxx.xxx.xxx.xxx/svn1即可访问
参考博客
[1]https://www.cnblogs.com/vijayfly/p/5711962.html
[2]http://blog.youkuaiyun.com/lake1314/article/details/23025571
[3]http://www.cnblogs.com/yjtx/p/4429613.html
[4]http://www.linuxidc.com/Linux/2016-01/127679.htm