Linux安装svn

简介: Linux安装svn


1.安装SVN


yum install subversion


2.验证SVN是否安装成功


svnserve --version


  • 有如下信息输出,说明是安装成功
[root@iZbp14w0b2rs7i1400bjjmZ ~]# svnserve --version
svnserve, version 1.6.11 (r934486)
   compiled Aug 17 2015, 08:37:43
Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository back-end (FS) modules are available:
* fs_base : Module for working with a Berkeley DB repository.
* fs_fs : Module for working with a plain file (FSFS) repository.
Cyrus SASL authentication is available.


3.建立SVN仓库

  • 建立svn目录
#使用隐藏目录,防止被删除
mkdir /home/.svn
  • 创建仓库CloudPayment
svnadmin create /home/.svn/CloudPayment

执行完毕后有svnadmin创建的目录和文件


  • subversion目录说明


db目录:就是所有版本控制的数据存放文件。
hooks目录:放置hook脚本文件的目录。
locks目录:用来放置subversion见艰苦锁定数据的目录,用来追踪存取文件库的客户端。
format文件:是一个文本文件,里面只放了一个整数,表示当前文件库配置的版本号。
conf目录:是这个仓库的配置文件(仓库的用户访问账号、权限等)。


  • conf目录
authz文件是权限控制文件


passwd是帐号密码文件svnserve.conf SVN服务配置文件

  • 创建仓库CloudPayment的用户和权限

设置帐号密码

vim passwd
在[users]块中添加用户和密码,格式:帐号=密码
[root@iZbp14w0b2rs7i1400bjjmZ conf]# cat passwd 
### 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
fly = 123456



设置权限

vim authz
在末尾添加如下代码:
[/]
账号=rw     说明: (r:读,w:写)
[root@iZbp14w0b2rs7i1400bjjmZ conf]# cat authz 
### 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
[/] 
fly = rw
[CloudPayment:/]
fly = rw


注意


用户如果不是一个组,去掉@ ,
否则会报错:svn:unable to connect to repository invalid authz configuration


修改svnserve.conf文件


vim svnserve.conf
打开下面的几个注释:
anon-access = read #匿名用户可读
auth-access = write #授权用户可写
password-db = passwd #使用哪个文件作为账号文件
authz-db = authz #使用哪个文件作为权限文件
realm = realm = /home/.svn # 认证空间名,版本库所在目录
[root@iZbp14w0b2rs7i1400bjjmZ conf]# cat svnserve.conf 
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.  (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)
### Visit http://subversion.tigris.org/ for more information.
[general]
### These options control access to the repository for unauthenticated
### and authenticated users.  Valid values are "write", "read",
### and "none".  The sample settings below are the defaults.
anon-access = read
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 = /home/.svn
[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
### integrity-checking only, values larger than 1 are correlated
### to the effective key length for encryption (e.g. 128 means 128-bit
### encryption). The values below are the defaults.
# min-encryption = 0
# max-encryption = 256


4.启动SVN

启动:
1. 从CloudPayment目录启动,svnserve -d -r /home/.svn/CloudPayment,
根目录(/)是CloudPayment,authz中规则的配置使用section[/]。
访问方式为: svn://ip/
2. 从.svn目录启动,svnserve -d -r /home/.svn,
根目录(/)是.svn,authz中对CloudPayment的配置使用section[CloudPayment:/] 。
访问方式为: svn://ip/CloudPayment
如果需要svn自启动,把命令加入/etc/rc.local中


检查svn服务器是否已经启动(svn默认使用3690端口)
netstat -an | grep 3690
 停止
killall svnserve


5.客户端连接测试

图片.png




目录
打赏
0
0
0
0
3334
分享
相关文章
在Ubuntu Linux系统下如何搭建并安装EDK2
以上就是在Ubuntu Linux系统下搭建并安装EDK2的过程。这个过程可能会有些复杂,但只要按照步骤一步步来,应该不会有太大问题。如果在过程中遇到任何问题,都可以在网上找到相应的解决方案。希望这个指南能对你有所帮助!
74 17
Linux数据库安装
本文介绍了在CentOS 8.0和Ubuntu 22.04系统上安装、配置和启动MariaDB数据库服务器的详细步骤。包括通过`yum`和`apt`包管理器安装MariaDB服务,启动并检查服务运行状态,设置root用户密码以及连接数据库的基本操作。此外,还展示了如何在Ubuntu上更新软件包列表、安装依赖项,并验证MariaDB的版本和运行状态。通过这些步骤,用户可以成功部署并初始化MariaDB环境,为后续数据库管理与应用开发奠定基础。
18 4
Oracle linux 8 二进制安装 MySQL 8.4企业版
Oracle linux 8 二进制安装 MySQL 8.4企业版
29 1
在Linux(CentOS和AWS)上安装更新的git2的方法并配置github-ssh
经过以上这些步骤,你现在就能在GitHub上顺利往返,如同海洋中的航海者自由驰骋。欢迎你加入码农的世界,享受这编程的乐趣吧!
55 10
|
19天前
|
Linux安装Elasticsearch详细教程
Linux安装Elasticsearch详细教程
57 1
|
27天前
|
利用PHP压缩音频:Linux环境下的ffmpeg简易安装指南
希望这个指南能为你的编程之旅提供帮助。只需记住,每一行代码都像音乐的音符,组合在一起,创造出美妙的旋律。祝你编程愉快!
77 6
零基础保姆级教程!手把手教你免费玩转Linux CentOS安装+学习环境搭建(附避坑指南)
本文详细介绍了在VMware虚拟机中安装CentOS 6.8的全过程。首先,需确保已安装VMware并开启V-CPU虚拟化功能,可通过BIOS设置或使用LeoMoon CPU-V工具检测。接着,下载CentOS镜像文件,并在VMware中新建虚拟机,配置CPU、内存、硬盘等参数。最后,加载ISO镜像启动虚拟机,按照提示完成CentOS的安装,包括语言、键盘、存储方式、地区、密码设置及硬盘分区等步骤。安装完成后,以root用户登录即可进入系统桌面,开始学习Linux命令和操作。
183 12
零基础保姆级教程!手把手教你免费玩转Linux CentOS安装+学习环境搭建(附避坑指南)
在Rocky Linux 9上安装JDK并配置环境变量!
本教程介绍在Rocky Linux 9上安装JDK并配置环境变量的完整步骤。首先更新系统,清理旧版本JDK相关包及残留文件,确保环境干净。接着搜索并安装所需版本的JDK(如OpenJDK 17),验证安装是否成功。然后查找JDK安装路径,配置全局环境变量`JAVA_HOME`和`PATH`,最后验证环境变量设置。按照此流程操作,可顺利完成Java开发环境搭建,支持多版本切换(如JDK 8/11/17)。生产环境请谨慎操作,避免影响现有服务。
153 21
YashanDB Linux客户端安装
本文详细介绍了YashanDB客户端在Linux系统中的安装、使用与卸载步骤。安装方法包括适用于所有Linux平台的脚本安装和专用于CentOS的rpm安装。脚本安装需解压软件包并配置环境变量,而rpm安装则需以root用户执行相关命令。此外,文章还说明了如何通过yasql连接YashanDB并进行数据库操作,以及两种安装方式对应的卸载方法,帮助用户顺利完成客户端的管理与维护。
Linux 手动安装快速部署 LNMP 环境实战
本文详细记录了在阿里云ECS上手动搭建LNMP环境的过程,系统选用Ubuntu 24.04。主要内容包括:1) 使用`apt`安装Nginx和MySQL,并更新软件源;2) 编译安装PHP 8.4.5,配置PHP-FPM及环境路径;3) 配置MySQL root用户密码;4) 调整Nginx支持PHP解析并测试整体环境。通过此过程,重现手动配置服务器的细节,帮助熟悉各组件的安装与协同工作。
121 23
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等