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




目录
相关文章
|
3月前
|
Linux
手把手教会你安装Linux系统
手把手教会你安装Linux系统
|
14天前
|
Linux Python
Linux 安装python3.7.6
本教程介绍在Linux系统上安装Python 3.7.6的步骤。首先使用`yum`安装依赖环境,包括zlib、openssl等开发库。接着通过`wget`下载Python 3.7.6源码包并解压。创建目标文件夹`/usr/local/python3`后,进入解压目录执行配置、编译和安装命令。最后设置软链接,使`python3`和`pip3`命令生效。
|
17天前
|
Ubuntu Linux
Linux 各发行版安装 ping 命令指南
如何在不同 Linux 发行版(Ubuntu/Debian、CentOS/RHEL/Fedora、Arch Linux、openSUSE、Alpine Linux)上安装 `ping` 命令,详细列出各发行版的安装步骤和验证方法,帮助系统管理员和网络工程师快速排查网络问题。
103 20
|
10天前
|
NoSQL 关系型数据库 MySQL
Linux安装jdk、mysql、redis
Linux安装jdk、mysql、redis
111 7
|
17天前
|
Unix Linux 编译器
UNIX/Linux 上的安装
UNIX/Linux 上的安装。
37 2
|
3月前
|
安全 关系型数据库 MySQL
Linux下安装mysql8.0(以tar.xz包安装--编译安装)
通过上述步骤,您完成了从下载、编译、安装到配置MySQL 8.0的全过程。此过程虽然较为复杂,但提供了对MySQL安装环境的完全控制,有助于满足特定的部署需求。在实际操作中,根据具体的系统环境,可能还需调整部分步骤或解决未预见的依赖问题。始终参考官方文档和社区资源,保持安装过程与最新版本的兼容性。
1224 67
|
3月前
|
Linux 测试技术 网络安全
Linux系统之安装OneNav个人书签管理器
【10月更文挑战第19天】Linux系统之安装OneNav个人书签管理器
122 5
Linux系统之安装OneNav个人书签管理器
|
2月前
|
NoSQL Linux PHP
如何在不同操作系统上安装 Redis 服务器,包括 Linux 和 Windows 的具体步骤
本文介绍了如何在不同操作系统上安装 Redis 服务器,包括 Linux 和 Windows 的具体步骤。接着,对比了两种常用的 PHP Redis 客户端扩展:PhpRedis 和 Predis,详细说明了它们的安装方法及优缺点。最后,提供了使用 PhpRedis 和 Predis 在 PHP 中连接 Redis 服务器及进行字符串、列表、集合和哈希等数据类型的基本操作示例。
73 4
|
3月前
|
监控 Java Linux
Linux系统之安装Ward服务器监控工具
【10月更文挑战第17天】Linux系统之安装Ward服务器监控工具
76 5
Linux系统之安装Ward服务器监控工具
|
2月前
|
存储 安全 数据管理
如何在 Rocky Linux 8 上安装和配置 Elasticsearch
本文详细介绍了在 Rocky Linux 8 上安装和配置 Elasticsearch 的步骤,包括添加仓库、安装 Elasticsearch、配置文件修改、设置内存和文件描述符、启动和验证 Elasticsearch,以及常见问题的解决方法。通过这些步骤,你可以快速搭建起这个强大的分布式搜索和分析引擎。
60 5