svn centos7.5 subverion 1.9.5安装步骤

1.删除当前的svn版本

[root@qht132 ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

[root@qht132 ~]# svn --version
svn, version 1.7.14 (r1542130)
   compiled Sep 30 2020, 17:44:04

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 access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme

[root@qht132 ~]# yum remove subversion
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package subversion.x86_64 0:1.7.14-16.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package            Arch           Version                  Repository     Size
================================================================================
Removing:
 subversion         x86_64         1.7.14-16.el7            @base         4.6 M

Transaction Summary
================================================================================
Remove  1 Package

Installed size: 4.6 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : subversion-1.7.14-16.el7.x86_64                              1/1
  Verifying  : subversion-1.7.14-16.el7.x86_64                              1/1

Removed:
  subversion.x86_64 0:1.7.14-16.el7

Complete!

2.下载安装Subversion必要的源码文件

安装svn需要apr,apr-util,zlib,serf,openssl的支持,serf的编译安装又需要scons
所以这里我们用yum来安装zlib和openssl,源码编译apr,apr-util,serf,scons
subversion1.9.5安装包:

Index of /dist/subversion

apr1.5.2和apr-util1.5.2源码包

Index of /dist/apr

serf1.3.9源码包

Index of /dist/serf

scone2.5.1源码包

SCons - Browse /scons/2.5.1 at SourceForge.net

sqlite-amalgamation源码包

http://www.sqlite.org/2017/sqlite-amalgamation-3160200.zip

3.安装所依赖的包

[root@qht132 ~]# yum -y install zlib zlib-devel openssl openssl-devel python

4.安装apr和apr-util

[root@qht132 resource]# mkdir -p /usr/local/apr
[root@qht132 resource]# tar -zxvf apr-1.5.2.tar.gz
[root@qht132 apr-1.5.2]# cd apr-1.5.2/
[root@qht132 apr-1.5.2]# ./configure --prefix=/usr/local/apr
[root@qht132 apr-1.5.2]# make && make install
[root@qht132 apr-1.5.2]# ll /usr/local/apr/
total 0
drwxr-xr-x. 2 root root  26 Mar 20 15:08 bin
drwxr-xr-x. 2 root root 108 Mar 20 15:08 build-1
drwxr-xr-x. 3 root root  19 Mar 20 15:08 include
drwxr-xr-x. 3 root root 140 Mar 20 15:08 lib
[root@qht132 resource]# mkdir -p /usr/local/apr-util
[root@qht132 resource]# tar -zxvf apr-util-1.5.2.tar.gz
[root@qht132 resource]# cd apr-util-1.5.2/
[root@qht132 apr-util-1.5.2]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@qht132 apr-util-1.5.2]# make && make install
[root@qht132 apr-util-1.5.2]# ll /usr/local/apr-util/
total 0
drwxr-xr-x. 2 root root  26 Mar 20 15:35 bin
drwxr-xr-x. 3 root root  19 Mar 20 15:35 include
drwxr-xr-x. 3 root root 266 Mar 20 15:35 lib

5.安装scons

[root@qht132 resource]# mkdir -p /usr/local/scons
[root@qht132 resource]# tar -zxvf scons-2.5.1.tar.gz
[root@qht132 resource]# cd scons-2.5.1/
[root@qht132 scons-2.5.1]# python setup.py install --prefix=/usr/local/scons
[root@qht132 scons-2.5.1]# ll /usr/local/scons/
total 0
drwxr-xr-x. 2 root root 182 Mar 20 15:37 bin
drwxr-xr-x. 3 root root  25 Mar 20 15:37 lib
drwxr-xr-x. 3 root root  18 Mar 20 15:37 man

6.安装serf

[root@qht132 resource]# mkdir -p /usr/local/serf
[root@qht132 resource]# tar -xf serf-1.3.9.tar.bz2
[root@qht132 resource]# cd serf-1.3.9/
[root@qht132 serf-1.3.9]# /usr/local/scons/bin/scons PREFIX=/usr/local/serf APR=/usr/local/apr APU=/usr/local/apr-util install
#注意这里的PREFIX APR和APU要大写
[root@qht132 serf-1.3.9]#  cp /usr/local/serf/lib/libserf-1.so*  /usr/local/lib

7.安装svn

[root@qht132 resource]# tar -zxvf subversion-1.9.5.tar.gz
[root@qht132 resource]# mkdir -p /usr/local/svn
[root@qht132 resource]# unzip sqlite-amalgamation-3160200.zip  -d /u01/resource/subversion-1.9.5
Archive:  sqlite-amalgamation-3160200.zip
[root@qht132 resource]# cd subversion-1.9.5/
[root@qht132 subversion-1.9.5]# mv sqlite-amalgamation-3160200/ sqlite-amalgamation
[root@qht132 subversion-1.9.5]# ./configure --prefix=/usr/local/svn --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-serf=/usr/local/serf --enable-mod-activation
[root@qht132 subversion-1.9.5]# make && make install
[root@qht132 subversion-1.9.5]# ll /usr/local/svn/
total 4
drwxr-xr-x. 2 root root  180 Mar 20 16:45 bin
drwxr-xr-x. 3 root root   26 Mar 20 16:45 include
drwxr-xr-x. 2 root root 4096 Mar 20 16:45 lib
drwxr-xr-x. 5 root root   48 Mar 20 16:45 share

8.检查是否成功

[root@qht132 ~]# echo "export PATH=/usr/local/svn/bin:$PATH" >> /etc/profile
[root@qht132 ~]# source /etc/profile

[root@qht132 ~]# svn --version
svn: error while loading shared libraries: libserf-1.so.1: cannot open shared object file: No such file or directory

出现这个错误,需要将/usr/local/lib加载一下
[root@qht132 ~]# cd /etc/ld.so.conf.d/
[root@qht132 ld.so.conf.d]# vi user-libs.conf
[root@qht132 ld.so.conf.d]# cat user-libs.conf
/usr/local/lib
[root@qht132 ld.so.conf.d]# ldconfig
ldconfig: /usr/local/lib/libserf-1.so.1 is not a symbolic link

[root@qht132 ld.so.conf.d]# svn --version
svn, version 1.9.5 (r1770682)
   compiled Mar 20 2022, 16:41:13 on x86_64-unknown-linux-gnu

Copyright (C) 2016 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 access (RA) modules are available:

* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - using serf 1.3.9 (compiled with 1.3.9)
  - handles 'http' scheme
  - handles 'https' scheme

The following authentication credential caches are available:

* Plaintext cache in /root/.subversion
* GPG-Agent

至此svn安装成功了。
 

9.建立仓库

[root@qht132 ~]# mkdir -p /u01/data/repos
[root@qht132 ~]# svnadmin create /u01/data/repos
[root@qht132 ~]# ll /u01/data/repos/
total 8
drwxr-xr-x. 2 root root  76 Mar 20 17:35 conf
drwxr-sr-x. 6 root root 233 Mar 20 17:35 db
-r--r--r--. 1 root root   2 Mar 20 17:35 format
drwxr-xr-x. 2 root root 231 Mar 20 17:35 hooks
drwxr-xr-x. 2 root root  41 Mar 20 17:35 locks
-rw-r--r--. 1 root root 246 Mar 20 17:35 README.txt

[root@qht132 conf]# cat authz
[/]
admin = rw


[root@qht132 conf]# cat passwd
admin = admin

[root@qht132 conf]# grep -v "#" svnserve.conf


[general]
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz
realm = My First Repository

[sasl]

10.启动和关闭服务

--开启服务
[root@qht132 ~]# svnserve -d -r /u01/data/repos/ --listen-port 3690
[root@qht132 ~]# ps -ef | grep svn
root      64623      1  0 17:45 ?        00:00:00 svnserve -d -r /u01/data/repos/ --listen-port 3690
root      64625  63909  0 17:45 pts/0    00:00:00 grep --color=auto svn
[root@qht132 ~]# netstat -nal | grep 3690
tcp        0      0 0.0.0.0:3690            0.0.0.0:*               LISTEN
unix  3      [ ]         STREAM     CONNECTED     33690
-关闭服务
[root@qht132 ~]# killall svnserve
[root@qht132 ~]# netstat -nal | grep 3690
unix  3      [ ]         STREAM     CONNECTED     33690

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值