代码拉取完成,页面将自动刷新
yum -y install subversion
此命令会全自动安装svn服务器相关服务和依赖,安装完成会自动停止命令运行。若需查看svn安装位置,可以用以下命令:
rpm -ql subversion
[root@localhost ~]# whereis svnserve
svnserve: /usr/bin/svnserve /usr/share/man/man8/svnserve.8.gz
[root@localhost ~]# which svnserve
/usr/bin/svnserve
[root@localhost ~]# svnserve --version
svnserve, version 1.7.14 (r1542130)
compiled Apr 11 2018, 02:40:28
Copyright (C) 2013 The Apache Software Foundation.
This software consists of contributions made by many people; see the NOTICE
file for more information.
Subversion is open source software, see http://subversion.apache.org/
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.
subversion默认以/var/svn作为数据根目录,可以通过/etc/sysconfig/svnserve修改这个默认位置。
[root@localhost ~]# cat /etc/sysconfig/svnserve
# OPTIONS is used to pass command-line arguments to svnserve.
#
# Specify the repository location in -r parameter:
OPTIONS="-r /var/svn"
[root@localhost ~]# vi /etc/sysconfig/svnserve
[root@localhost ~]# cat /etc/sysconfig/svnserve
# OPTIONS is used to pass command-line arguments to svnserve.
#
# Specify the repository location in -r parameter:
#OPTIONS="-r /var/svn"
OPTIONS="-r /data/subversion"
[root@localhost ~]#
mkdir -p /data/subversion
svnadmin create /data/subversion/repo1
为了能够统一管理SVN的用户、组、权限等,这里设置采用统一文件进行管理的方式。
复制仓库repo1
中的conf
目录下的authz
和passwd
文件到仓库根目录下,并重命名:
cp /data/subversion/repo1/conf/authz /data/subversion/svnauthz
cp /data/subversion/repo1/conf/passwd /data/subversion/svnpasswd
并且,修改仓库配置文件,将用户、权限控制配置项指向统一配置文件:
[root@localhost ~]# vi /data/subversion/repo1/conf/svnserve.conf
[general]
anon-access = read
auth-access = write
password-db = /data/subversion/svnpasswd
authz-db = /data/subversion/svnauthz
systemctl start svnserve.service
svn://service.hy-wux.com/repo1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。