1,svn安装
通过yum命令进行安装svn服务器搭建和使用svn服务器搭建和使用,命令如下:
[root@ ~]$ yum -y
已加载插件:,
from
* base:
* :
* :
base | 3.6 kB 00:00:00
| 2.9 kB 00:00:00
| 2.9 kB 00:00:00
正在解决依赖关系
--> 正在检查事务
---> 软件包
..0.1.7.14-16.el7 将被 安装
--> 正在处理依赖关系 -libs(x86-64) = 1.7.14-16.el7,它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在处理依赖关系 -1.so.0()(64bit),它被软件包
-1.7.14-16.el7. 需要
--> 正在检查事务
---> 软件包 apr..0.1.4.8-7.el7 将被 安装
---> 软件包
apr-util..0.1.5.2-6.el7 将被 安装
---> 软件包
-libs..0.1.7.14-16.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
=========================================================================================================================================================================
架构 版本 源 大小
=========================================================================================================================================================================
正在安装:
1.7.14-16.el7 base 1.0 M
为依赖而安装:
apr 1.4.8-7.el7 base 104 k
apr-util 1.5.2-6.el7 base 92 k
-libs 1.7.14-16.el7 base 922 k
事务概要
=========================================================================================================================================================================
安装 1 软件包 (+3 依赖软件包)
总下载量:2.1 M
安装大小:7.5 M
:
(1/4):
apr-util-1.5.2-6.el7..rpm | 92 kB 00:00:02
(2/4):
apr-1.4.8-7.el7..rpm | 104 kB 00:00:03
(3/4):
-1.7.14-16.el7..rpm | 1.0 MB 00:00:09
(4/4):
-libs-1.7.14-16.el7..rpm | 922 kB 00:00:22
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 96 kB/s | 2.1 MB 00:00:22
check
test
test
正在安装 : apr-1.4.8-7.el7. 1/4
正在安装 :
apr-util-1.5.2-6.el7. 2/4
正在安装 :
-libs-1.7.14-16.el7. 3/4
正在安装 :
-1.7.14-16.el7. 4/4
验证中 :
-libs-1.7.14-16.el7. 1/4
验证中 : apr-1.4.8-7.el7. 2/4
验证中 :
-1.7.14-16.el7. 3/4
验证中 :
apr-util-1.5.2-6.el7. 4/4
已安装:
. 0:1.7.14-16.el7
作为依赖被安装:
apr. 0:1.4.8-7.el7 apr-util. 0:1.5.2-6.el7 -libs. 0:1.7.14-16.el7
完毕!
2,创建svn版本库
1)创建仓库文件夹,命令如下:
[root@ opt]# mkdir -p /opt/svn/
2)创建svn版本库,命令如下:
[root@ opt]# /opt/svn/
创建成功,进入/opt/svn/文件夹,信息如下:
[root@ opt]# cd /opt/svn//
[root@ ]# ll
总用量 8
drwxr-xr-x. 2 root root 54 6月 6 17:52 conf
drwxr-sr-x. 6 root root 233 6月 6 17:52 db
-r--r--r--. 1 root root 2 6月 6 17:52
drwxr-xr-x. 2 root root 231 6月 6 17:52 hooks
drwxr-xr-x. 2 root root 41 6月 6 17:52 locks
-rw-r--r--. 1 root root 229 6月 6 17:52 .txt
3,权限配置
进入/opt/svn//conf目录,有如下三个文件:
[root@ conf]# ll
总用量 12
-rw-r--r--. 1 root root 1080 6月 6 17:52 authz
-rw-r--r--. 1 root root 309 6月 6 17:52
-rw-r--r--. 1 root root 3090 6月 6 17:52 .conf
文件说明:
authz:负责账号权限的管理,控制账号是否读写权限
:负责账号和密码的用户名单管理
.conf:svn服务器配置文件
1)authz配置
执行vim authz,配置关键信息如下:
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
#分组,等号前面为组名称,等号后面为成员名称,多个成员用英文逗号隔开
[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
admin=admin
dev=zhangsan,lisi,wangwu
# [/foo/bar]
# harry = rw
# &joe = r
# * =
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
#[/]表示根目录,即/opt/svn/repository/
[/]
#@加组名称,给该组赋权,r表示读,w表示写
@admin=rw
#[/dev]实际上为/opt/svn/repository/dev
[/dev]
@dev=rw
2)配置
执行 vim ,配置svn访问用户和密码:
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
[users]
# harry = harryssecret
# sally = sallyssecret
# 等号前面为用户名,后面为登录密码
admin = admin@123
zhangsan = zhang@123
lisi = li@123
wangwu = wang@123
3)配置 .conf
执行vim .conf,配置访问权限,关键信息如下:
### users have read-only access to the repository, while authenticated
### users have read and write access to the repository.
anon-access = none
auth-access = write
### users have read and write access to the repository.
anon-access = none
auth-access = write
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file. If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa. The default realm
### is repository's uuid.
realm = /opt/svn/repository
配置说明:
anon- = none:表示禁止匿名用户访问
auth- = write:表示授权用户拥有读写权限
-db = :指定用户名口令文件,即文件
authz-db = authz:指定权限配置文件,即authz文件
realm = /opt/svn/:指定认证域,即/opt/svn/目录
4,启动svn服务
svn默认端口为3690,可以指定端口启动,如3696,启动命令如下:
[root@ ~]# -d -r /opt/svn ---port 3696
启动成功后,通过ps -ef | grep svn查看进程,显示如下信息:
[root@ ~]# ps -ef|grep svn
root 12499 1 0 22:04 ? 00:00:00 -d -r /opt/svn ---port 3696
root 13482 1386 0 22:05 pts/1 00:00:00 grep --color=auto svn
5,客户端访问svn服务器
使用 IDEA编辑器,通过check out 拉取文件,如图:
提交文件至svn服务器,如图:
在此,svn服务器搭建完成,如果有问题,欢迎各位指正。
注意事项:1,上述操作都是采用root权限进行
2,需要关闭防火墙或者在防火墙配置中开放svn端口
限时特惠:本站持续每日更新海量各大内部创业课程,一年会员仅需要98元,全站资源免费下载
点击查看详情
站长微信:Jiucxh