CentOS 搭建 SVN

本文详细介绍了如何在CentOS上安装和配置SVN,包括通过yum安装SVN,创建版本库,编辑配置文件,启动SVN服务,以及安装和使用客户端进行访问。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

目录

 

一、安装 SVN

1. 通过 yum 下载并安装

2. 查看 SVN 版本

3. 查看 SVN 安装目录

二、SVN 版本库

1. 创建版本库目录

2. 创建版本库

3. 复制版本库配置文件到根目录

3.1 复制用户账户权限管理配置文件

3.2 复制用户账号密码管理配置文件

三、编辑版本库管理及配置文件

1. /var/svnrepos/conf/authz

1.1 修改内容

1.2 完整配置文件内容

2. /var/svnrepos/conf/passwd

2.1 修改内容

2.2 完整配置文件内容

3. /var/svnrepos/svn0/conf/svnserve.conf

3.1 修改内容

3.2 完整配置文件内容

四、启动 SVN

1. 使用 systemctl 命令启动

1.1 修改启动相关文件

1.2 手动启动

1.3 设置开机自启动

2. 使用 svnserve 命令启动

2.1 手工启动

2.2 修改开机自启动文件

3. 查看 SVN 进程

3.1 查看进程状态

3.2 查看进程端口

五、访问 SVN

1. 下载客户端和中文语言包

2. 安装客户端

2.1 欢迎界面

2.2 许可界面

2.3 功能路径界面

2.4 安装前确认

2.5 安装完毕

3. 安装中文语言包

3.1 欢迎界面

3.2 安装完毕

3.3 设置中文语言

4. 访问

 


 

一、安装 SVN

1. 通过 yum 下载并安装

yum install subversion

[root@izbp11tfz245ne0doug99kz ~]# yum install subversion

 

2. 查看 SVN 版本

svnserve --version

[root@izbp11tfz245ne0doug99kz ~]# svnserve --version

 

3. 查看 SVN 安装目录

rpm -ql subversion

[root@izbp11tfz245ne0doug99kz ~]# rpm -ql subversion

 

 

二、SVN 版本库

1. 创建版本库目录

mkdir /var/svnrepos

为后面创建版本库提供存放位置。

[root@izbp11tfz245ne0doug99kz ~]# mkdir /var/svnrepos

 

2. 创建版本库

svnadmin create --fs-type fsfs /var/svnrepos/svn0

指定版本库存放的文件结构,有 fsfs 和 dbd,推荐使用 fsfs。

[root@izbp11tfz245ne0doug99kz ~]# svnadmin create --fs-type fsfs /var/svnrepos/svn0

 

3. 复制版本库配置文件到根目录

3.1 复制用户账户权限管理配置文件

cp /var/svnrepos/svn0/conf/authz /var/svnrepos/conf/

[root@izbp11tfz245ne0doug99kz ~]# cp /var/svnrepos/svn0/conf/authz /var/svnrepos/conf/

3.2 复制用户账号密码管理配置文件

cp /var/svnrepos/svn0/conf/passwd /var/svnrepos/conf/

[root@izbp11tfz245ne0doug99kz ~]# cp /var/svnrepos/svn0/conf/passwd /var/svnrepos/conf/

 

 

三、编辑版本库管理及配置文件

1. /var/svnrepos/conf/authz

用户账号权限管理。

1.1 修改内容

[/]
USER1 = rw
USER2 = rw

1.2 完整配置文件内容

### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
###  - a single user,
###  - a group of users defined in a special [groups] section,
###  - an alias defined in a special [aliases] section,
###  - all authenticated users, using the '$authenticated' token,
###  - only anonymous users, using the '$anonymous' token,
###  - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

[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

# [/foo/bar]
# harry = rw
# &joe = r
# * =

# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r

[/]
USER1 = rw
USER2 = rw

 

2. /var/svnrepos/conf/passwd

用户账号密码管理。

2.1 修改内容

USER1 = PASSWORD1
USER2 = PASSWORD2

2.2 完整配置文件内容

### 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 on
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值