Compile and install svn 1.8 on CENTOS 6.5

1. SSH to your server as root and remove old version if installed from yum

$ yum remove subversion 

2. goto /sandbox/svn_configuration  #you can make another name that you wish 

$ cd /sandbox/svn_configuration 

3. download source from http://subversion.apache.org/download/ 

$ wget http://labs.mop.com/apache-mirror/subversion/subversion-1.8.15.tar.bz2 

done, then:

$ tar xvf subversion-1.8.15.tar.bz2 

If you don't have this file, please download it from: http://subversion.apache.org/download/

4. goto svn directory $ cd /sandbox/svn_configuration/subversion-1.8.15

Before compile the library of subversion, we need to compile and intall 3 related libraries below:

3 related libraries list: apr-util-1.5.4.tar.gz, apr-1.5.2.tar.gz, sqlite-amalgamation-3110000.zip

(1) use the command below to get apr-util-1.5.4.tar.gz 

$ wget http://www.motorlogy.com/apache//apr/apr-util-1.5.4.tar.gz 

(2) use the below command to get apr-1.5.2.tar.gz 

$ wget http://mirror.tcpdiag.net/apache//apr/apr-1.5.2.tar.gz 

(3) get sqlite-amalgamation-3110000.zip by the below command

$ wget http://www.sqlite.org/sqlite-amalgamation-3110000.zip

(4) use the commands below to extract these 3 libraries above 

$ tar zxf apr-1.5.2.tar.gz

$ tar zxf apr-util-1.5.4.tar.gz

$ unzip sqlite-amalgamation-3110000.zip 

(5) the next, we need to compile and intall them one by one

first: apr-1.4.5

$ cd apr-1.5.2
$ ./configure --prefix=/usr/local/svn/apr #config apr to the directory:/usr/local/svn/apr
$ make
$ make install

second: apr-util 

$ cd apr-util-1.5.4
$ ./configure --prefix=/usr/local/svn/apr-util --with-apr=/usr/local/svn/apr
$ make
$make install

third:sqlite-amalgamation 

$ mv sqlite-amalgamation-3110000 sqlite-amalgamation 

finally, we compile and intall subversion 

$ ./configure --prefix=/usr/local/svn --with-apr=/usr/local/svn/apr --with-apr-util=/usr/local/svn/apr-util
$ make
$ make install 

Check the version of SVN: 

$ svn --version

Result would be:

svn, version 1.8.15 (r1718365)
   compiled Feb 24 2016, 13:29:14 on x86_64-unknown-linux-gnu

Copyright (C) 2015 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

5. The last, we have to configure some environment variables, such as svn port number.. to make svn works normally on terminal:

(1) The below is a case about configuring PATH's content, we need to add the path of svn installation directory into the content of PATH:

  (Note: the different directories should be divided with “” as below)

export PATH=/usr/local/svn/bin:/usr/lib/oracle/12.1/client64/bin:$PATH

(2) Then we should set the environment variable: SVN_SSH, the case below is just a case.

  (Note: /home/jeffreyxu/.ssh/shorelinesvn means your own svn secret key,  26 means the port number that be used in currently

export SVN_SSH="ssh -i /home/jeffreyxu/.ssh/shorelinesvn -p 26"

Now, I believe that SVN can be used normally!



原文地址:https://www.cnblogs.com/Jeffrey-xu/p/5223221.html