start_time: 2024-04-27 05:41:22 +0800

CentOS 8.0 搭建SVN服务

96
复苏的兵马俑
IP属地: 上海
0.4 2019.10.14 15:29 字数 1517

CentOS 8.0系统的安装见文章《CentOS 8.0 图形化安装
CentOS 8.0系统的基本配置见文章《CentOS 8.0 基本配置
CentOS 8.0系统创建LVM分区见文章《CentOS 8.0 创建LVM分区

1. 安装SVN
[root@Server ~]# yum -y install subversion            //使用YUM安装SVN
Last metadata expiration check: 0:17:56 ago on Wed 25 Sep 2019 04:49:06 PM CST.
Dependencies resolved.
(中间省略……)
Verifying        : apr-util-openssl-1.6.1-6.el8.x86_64                      4/8
  Verifying        : libserf-1.3.9-8.module_el8.0.0+45+75bba4f4.x86_64      5/8
  Verifying        : subversion-1.10.2-1.module_el8.0.0+45+75bba4f4.x86_64  6/8
  Verifying        : subversion-libs-1.10.2-1.module_el8.0.0+45+75bba4f4.x86_64 7/8
  Verifying        : utf8proc-2.1.1-4.module_el8.0.0+45+75bba4f4.x86_64     8/8

Installed:
  subversion-1.10.2-1.module_el8.0.0+45+75bba4f4.x86_64  apr-util-bdb-1.6.1-6.el8.x86_64                             apr-util-openssl-1.6.1-6.el8.x86_64                 apr-1.6.3-9.el8.x86_64  apr-util-1.6.1-6.el8.x86_64
  libserf-1.3.9-8.module_el8.0.0+45+75bba4f4.x86_64      subversion-libs-1.10.2-1.module_el8.0.0+45+75bba4f4.x86_64  utf8proc-2.1.1-4.module_el8.0.0+45+75bba4f4.x86_64

Complete!
2. 创建SVN库
[root@Server ~]# mkdir /Data/Svn            //创建SVN目录
[root@Server ~]# svnserve -d -r /Data/Svn
[root@Server ~]# svnadmin create /Data/Svn/01-ProductManagement
[root@Server ~]# svnadmin create /Data/Svn/02-ProductPrototype
[root@Server ~]# svnadmin create /Data/Svn/03-AxureTeamProject
[root@Server ~]# ls /Data/Svn/
01-ProductManagement  02-ProductPrototype  03-AxureTeamProject
[root@Server ~]# ls /Data/Svn/01-ProductManagement/
conf  db  format  hooks  locks  README.txt
3. 配置SVN
[root@Server ~]# mkdir /Data/Svn/Conf
[root@Server ~]# cp /Data/Svn/01-ProductManagement/conf/* /Data/Svn/Conf/
[root@Server ~]# cd /Data/Svn/Conf/
[root@Server Conf]# ls
authz  passwd  svnserve.conf
[root@Server Conf]# vi 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

SuperAdmin = admin
Jacky.xi = admin,jacky.xi

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

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

[01-ProductManagement:/]
@SuperAdmin = rw

[02-ProductPrototype:/]
@SuperAdmin = rw

[03-AxureTeamProject:/]
@SuperAdmin = rw
[root@Server conf]# vi 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

admin = 1qaz@WSX
jacky.xi = jacky888
[root@Server Conf]# vi 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.apache.org/ for more information.

[general]
### The anon-access and auth-access options control access to the
### repository for unauthenticated (a.k.a. anonymous) users and
### authenticated users, respectively.
### Valid values are "write", "read", and "none".
### Setting the value to "none" prohibits both reading and writing;
### "read" allows read-only access, and "write" allows complete
### read/write access to the repository.
### The sample settings below are the defaults and specify that anonymous
### 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
### 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 = /Data/Svn/Conf/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
### directory containing this file.  The specified path may be a
### repository relative URL (^/) or an absolute file:// URL to a text
### file in a Subversion repository.  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 = /Data/Svn/Conf/authz
### The groups-db option controls the location of the file with the
### group definitions and allows maintaining groups separately from the
### authorization rules.  The groups-db file is of the same format as the
### authz-db file and should contain a single [groups] section with the
### group definitions.  If the option is enabled, the authz-db file cannot
### contain a [groups] section.  Unless you specify a path starting with
### a /, the file's location is relative to the directory containing this
### file.  The specified path may be a repository relative URL (^/) or an
### absolute file:// URL to a text file in a Subversion repository.
### This option is not being used by default.
# groups-db = groups
### 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 = Svn
### The force-username-case option causes svnserve to case-normalize
### usernames before comparing them against the authorization rules in the
### authz-db file configured above.  Valid values are "upper" (to upper-
### case the usernames), "lower" (to lowercase the usernames), and
### "none" (to compare usernames as-is without case conversion, which
### is the default behavior).
# force-username-case = none
### The hooks-env options specifies a path to the hook script environment
### configuration file. This option overrides the per-repository default
### and can be used to configure the hook script environment for multiple
### repositories in a single file, if an absolute path is specified.
### Unless you specify an absolute path, the file's location is relative
### to the directory containing this file.
# hooks-env = hooks-env

[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### Enabling this option requires svnserve to have been 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
[root@Server Conf]# cp svnserve.conf /Data/Svn/01-ProductManagement/conf/
cp: overwrite '/Data/Svn/01-ProductManagement/conf/svnserve.conf'? y
[root@Server Conf]# cp svnserve.conf /Data/Svn/02-ProductPrototype/conf/
cp: overwrite '/Data/Svn/02-ProductPrototype/conf/svnserve.conf'? y
[root@Server Conf]# cp svnserve.conf /Data/Svn/03-AxureTeamProject/conf/
cp: overwrite '/Data/Svn/03-AxureTeamProject/conf/svnserve.conf'? y
4. 启动SVN服务
[root@Server Conf]# vi /usr/lib/systemd/system/svnserve.service             //创建svnserve.service服务
[Unit]
Description=Subversion protocol daemon
After=syslog.target network.target
Documentation=man:svnserve(8)

[Service]
Type=forking
EnvironmentFile=/etc/sysconfig/svnserve
#ExecStart=/usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid $OPTIONS
ExecStart=/usr/bin/svnserve --daemon $OPTIONS
PrivateTmp=yes

[Install]
WantedBy=multi-user.target
[root@Server Conf]# systemctl daemon-reload
[root@Server Conf]# vi /etc/sysconfig/svnserve

# OPTIONS is used to pass command-line arguments to svnserve.
#
# Specify the repository location in -r parameter:
OPTIONS="-r /Data/Svn"
[root@Server Conf]# systemctl status svnserve.service               //查看SVN服务状态
● svnserve.service - Subversion protocol daemon
   Loaded: loaded (/usr/lib/systemd/system/svnserve.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:svnserve(8)
[root@Server Conf]# systemctl start svnserve.service           //启动SVN服务
[root@Server Conf]# systemctl enable svnserve.service          //设置SVN服务开机自启动
Created symlink /etc/systemd/system/multi-user.target.wants/svnserve.service → /usr/lib/systemd/system/svnserve.service.
5. 安装SVN客户端(Windows版)

1、下载TortoiseSVN安装包及语言包
链接:https://pan.baidu.com/s/1A52eiAgLsf4MsLUhPb9Btw
提取码:nso4

2、安装TortoiseSVN


图-01.png
图-02.png
图-03.png
图-04.png
图-05.png
图-06.png
图-07.png

3、安装简体中文语言包


图-08.png
图-09.png
图-10.png
6. 检出SVN库

1、如图-11所示,在“D:\全栈POT\Svn”目录下的空白处点击鼠标右键,点击“SVN 检出(K)...”。


图-11.png

2、如图-12所示,在“检出”界面中填入“版本库URL”和“检出至目录”,版本库URL为“svn://172.29.1.190/01-ProductManagement”,检出至目录为“D:\全栈POT\Svn\01-产品管理”,点击“确定”。

图-12.png

3、如图-13所示,认证用户权限,填入“用户名”和“密码”,用户名为“admin”,密码为“1qaz@WSX”,并勾选“保存认证”,点击“确定”。


图-13.png

4、如图-14所示,检出成功,当前版本为0,点击“确定”。


图-14.png

5、如图-15所示,在“D:\全栈POT\Svn”目录下已经存在从SVN库检出的“01-产品管理”目录。


图-15.png

6、如图-16所示,检出“02-ProductPrototype”,在“检出”界面中填入“版本库URL”和“检出至目录”,版本库URL为“svn://172.29.1.190/02-ProductPrototype”,检出至目录为“D:\全栈POT\Svn\02-产品原型HTML”,点击“确定”。

图-16.png

7、如图-17所示,检出“03-AxureTeamProject”,在“检出”界面中填入“版本库URL”和“检出至目录”,版本库URL为“svn://172.29.1.190/03-AxureTeamProject”,检出至目录为“D:\全栈POT\Svn\03-Axure团队项目”,点击“确定”。

图-17.png

8、如图-18所示,“01-ProductManagement”、“02-ProductPrototype”和“03-AxureTeamProject”均已被成功检出,分别对应“01-产品管理”、“02-产品原型HTML”和“03-Axure团队项目”。


图-18.png

9、在“01-产品管理”目录下创建目录“01-PersonalFolder”以及在“01-PersonalFolder”目录下创建目录“01-Jacky.xi”,如图-19所示。


图-19.png

10、如图-20所示,在“01-产品管理”目录下的空白处点击鼠标右键,点击“SVN 提交(C)...”。


图-20.png

11、如图-21所示,在变更列表中选中需要提交的文件或文件夹,点击“确定”。


图-21.png

12、如图-22所示,提交成功,当前版本为1,点击“确定”。


图-22.png

13、如图-23所示,目录“01-PersonalFolder”及其子目录“01-Jacky.xi”已提交成功。


图-23.png

14、在“02-产品原型HTML”目录下创建目录“01-Jacky.xi”,并执行“SVN提交(C)...”,如图-24所示,在变更列表中选中需要提交的文件或文件夹,点击“确定”并提交成功。


图-24.png

15、在“03-Axure团队项目”目录下创建目录“01-Jacky.xi”,并执行“SVN提交(C)...”,如图-25所示,在变更列表中选中需要提交的文件或文件夹,点击“确定”并提交成功。


图-25.png
7. 更新SVN权限配置
[root@Server Conf]# vi 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

SuperAdmin = admin
Jacky.xi = admin,jacky.xi

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

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

[01-ProductManagement:/]
@SuperAdmin = rw
[01-ProductManagement:/01-PersonalFolder/01-Jacky.xi]
@Jacky.xi = rw

[02-ProductPrototype:/]
@SuperAdmin = rw
[02-ProductPrototype:/01-Jacky.xi]
@Jacky.xi = rw

[03-AxureTeamProject:/]
@SuperAdmin = rw
[03-AxureTeamProject:/01-Jacky.xi]
@Jacky.xi = rw
8. 用户Jacky.xi检出。

1、如图-26所示,在“D:\全栈POT\Svn-Jacky.xi”目录下的空白处点击鼠标右键,点击“SVN 检出(K)...”。


图-26.png

2、如图-27所示,在“检出”界面中填入“版本库URL”和“检出至目录”,版本库URL为“svn://172.29.1.190/01-ProductManagement/01-PersonalFolder/01-Jacky.xi”,检出至目录为“D:\全栈POT\Svn-Jacky.xi\01-产品管理\01-个人目录\01-Jacky.xi”,点击“确定”。

图-27.png

3、如图-28所示,认证用户权限,填入“用户名”和“密码”,用户名为“jacky.xi”,密码为“jacky888”,并勾选“保存认证”,点击“确定”。


图-28.png

4、如图-29所示,检出成功,当前版本为1,点击“确定”。


图-29.png

5、如图-30所示,Jacky.xi已成功检出“svn://172.29.1.190/01-ProductManagement/01-PersonalFolder/01-Jacky.xi”。

图-30.png

6、如图-31所示,检出“02-ProductPrototype\01-Jacky.xi”,在“检出”界面中填入“版本库URL”和“检出至目录”,版本库URL为“svn://172.29.1.190/02-ProductPrototype/01-Jacky.xi”,检出至目录为“D:\全栈POT\Svn-Jacky.xi\02-产品原型HTML\01-Jacky.xi”,点击“确定”。

图-31.png

7、如图-32所示,检出“03-AxureTeamProject\01-Jacky.xi”,在“检出”界面中填入“版本库URL”和“检出至目录”,版本库URL为“svn://172.29.1.190/03-AxureTeamProject/01-Jacky.xi”,检出至目录为“D:\全栈POT\Svn-Jacky.xi\03-Axure团队项目\01-Jacky.xi”,点击“确定”。

图-32.png

8、如图-33所示,“01-ProductManagement\01-PersonalFolder\01-Jacky.xi”、“02-ProductPrototype\01-Jacky.xi”和“03-AxureTeamProject\01-Jacky.xi”均已被成功检出,分别对应“01-产品管理\01-个人目录\01-Jacky.xi”、“02-产品原型HTML\01-Jacky.xi”和“03-Axure团队项目\01-Jacky.xi”。


图-33.png
最后编辑于 :2019-10-22 14:57:02
©著作权归作者所有,转载或内容合作请联系作者
序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
783c64db 45e5 48d7 82e4 95736f50533e 沈念sama 阅读 159117 评论 4 赞 362
序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
783c64db 45e5 48d7 82e4 95736f50533e 沈念sama 阅读 67328 评论 1 赞 293
文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
8 开封第一讲书人 阅读 108839 评论 0 赞 243
文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
8 开封第一讲书人 阅读 44007 评论 0 赞 206
正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
388e473c fe2f 40e0 9301 e357ae8f1b41 茶点故事 阅读 52384 评论 3 赞 287
文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
8 开封第一讲书人 阅读 40629 评论 1 赞 219
那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
783c64db 45e5 48d7 82e4 95736f50533e 沈念sama 阅读 31880 评论 2 赞 313
文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
8 开封第一讲书人 阅读 30593 评论 0 赞 198
序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
783c64db 45e5 48d7 82e4 95736f50533e 沈念sama 阅读 34313 评论 1 赞 243
正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
388e473c fe2f 40e0 9301 e357ae8f1b41 茶点故事 阅读 30575 评论 2 赞 246
正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
388e473c fe2f 40e0 9301 e357ae8f1b41 茶点故事 阅读 32066 评论 1 赞 260
序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
783c64db 45e5 48d7 82e4 95736f50533e 沈念sama 阅读 28392 评论 2 赞 253
正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
388e473c fe2f 40e0 9301 e357ae8f1b41 茶点故事 阅读 33052 评论 3 赞 236
文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
8 开封第一讲书人 阅读 26082 评论 0 赞 8
文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
8 开封第一讲书人 阅读 26844 评论 0 赞 195
我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
783c64db 45e5 48d7 82e4 95736f50533e 沈念sama 阅读 35662 评论 2 赞 274
正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
388e473c fe2f 40e0 9301 e357ae8f1b41 茶点故事 阅读 35575 评论 2 赞 270
end_time: 2024-04-27 05:41:22 +0800 Completed in 65.499739ms