执行yum install subversion
执行分析后需要的其他依赖

Dependencies Resolved
================================================================================
 Package                Arch          Version                 Repository   Size
================================================================================
Installing:
 subversion             x86_64        1.7.14-10.el7           base        1.0 M
Installing for dependencies:
 apr                    x86_64        1.4.8-3.el7             base        103 k
 apr-util               x86_64        1.5.2-6.el7             base         92 k
 subversion-libs        x86_64        1.7.14-10.el7           base        921 kTransaction Summary
================================================================================

Install  1 Package (+3 Dependent packages)

yum Centos7上搭建SVN_用户名


 安装成功后的效果

yum Centos7上搭建SVN_运维_02


  1.创建svn用户组

[root@localhost ~]# groupadd svngroup

2.创建svn用户

[root@localhost ~]# useradd -g svngroup svnuser

3.为svn用户指定密码

[root@localhost ~]# passwd svnuser

Changing password for user svnuser.

New password:

BAD PASSWORD: The password is shorter than 8 characters

Retype new password:

passwd: all authentication tokens updated successfully.

[root@localhost ~]#

4.创建svn的目录

[svnuser@localhost ~]$ mkdir -p  svn/project

5.新建一个版本仓库

[svnuser@localhost ~]$ svnadmin create /home/svnuser/svn/project/

此时在/home/svnuser/svn/project/下出现:conf/ db/ format hooks/ locks/ README.txt

yum Centos7上搭建SVN_用户名_03


6.设置web访问的用户名和密码

编辑文件/home/svnuser/svn/project/conf/passwd

在[users] 按照一下格式设置用户名和密码:

用户名1=密码1

用户名2=密码2

[users]

# harry = harryssecret

# sally = sallyssecret

liulangyu = 123456

liulangyu2 = 1234567

yum Centos7上搭建SVN_svn_04


 7.设置户目录权限

編輯文件/home/svnuser/svn/project/conf/authz

[groups]

testgroup = liulangyu,liulangyu2

[/]

@testgroup = rw

*=

yum Centos7上搭建SVN_ci_05


 

8.设置svn访问策略

编辑文件/home/svnuser/svn/project/conf/svnserve.conf

anon-access = read

auth-access = write

password-db = passwd

authz-db = authz

yum Centos7上搭建SVN_svn_06


 

9.启动svn服务

[svnuser@localhost conf]$ svnserve -d -r /home/svnuser/svn/project/

svn服务默认的端口号3690

[svnuser@localhost conf]$ netstat -ntlp 用netstat命令查看3690端口是否开发


yum Centos7上搭建SVN_网络_07


 

10.防火墙通过3690
因为开启防火墙,所以必须把3690端口进行开放
vi /etc/sysconfig/iptables
加入: -A INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
service iptables restart

 

yum Centos7上搭建SVN_svn_08

11.客户端进行测试

yum Centos7上搭建SVN_网络_09


 12.测试添加目录

yum Centos7上搭建SVN_svn_10

13svnserver服务关闭

[root@localhost project]# ps -ef | grep svnserve

yum Centos7上搭建SVN_网络_11


 kill -9 ID号