原文地址:

安装脚本如下:

#!/bin/bash                                                                    yum -y remove subversion mkdir -p /dist/{dist,src} cd /dist/dist /bin/rm -f openssl* subversion* wget "http://www.openssl.org/source/openssl-1.0.1c.tar.gz" wget "http://labs.mop.com/apache-mirror/subversion/subversion-1.7.8.tar.gz" wget "http://mirror.bjtu.edu.cn/apache/apr/apr-1.4.6.tar.gz" wget "http://mirror.bjtu.edu.cn/apache/apr/apr-util-1.5.1.tar.gz" wget "http://www.sqlite.org/sqlite-autoconf-3071502.tar.gz" wget "http://www.webdav.org/neon/neon-0.29.6.tar.gz"                                                                    cd /dist/src rm -rf openssl* rm -rf subversion* rm -rf apr* rm -rf sqlite* rm -rf neon*                                                                    tar xf /dist/dist/openssl-1.0.1c.tar.gz cd openssl-1.0.1c ./config --prefix=/usr/local/ssl-1.0.1c shared ./config -t make make install echo '/usr/local/ssl-1.0.1c/lib' >/etc/ld.so.conf.d/openssl.conf ldconfig -v cd /dist/src tar xf /dist/dist/apr-1.4.6.tar.gz cd apr-1.4.6/ ./configure --prefix=/usr/local/apr make make install cd /dist/src tar xf /dist/dist/apr-util-1.5.1.tar.gz cd apr-util-1.5.1/ ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr make make install cd /dist/src tar xf /dist/dist/sqlite-autoconf-3071502.tar.gz cd sqlite-autoconf-3071502 ./configure --prefix=/usr/local/sqlite make make install cd /dist/src tar xf /dist/dist/neon-0.29.6.tar.gz cd neon-0.29.6 ./configure --prefix=/usr/local/neon --with-ssl=openssl make make install                                                                    cd /dist/src tar xf /dist/dist/subversion-1.7.8.tar.gz cd subversion-1.7.8 ./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-sqlite=/usr/local/sqlite --with-ssl --without-berkeley-db --with-neon=/usr/local/neon make  make install                                                                    ln -s /usr/local/bin/svn /usr/bin/

在安装过程中遇到的几个问题:

1、安装subversion后,在svn co https://www.xxx.com/的时候报错:

svn: E170000: Unrecognized URL scheme for

   说明svn不支持https协议,可以通过svn --version进行查看

2.默认安装好neon的时候,svn是不支持https方式的,通过svn --version可以看到:  

The following repository access (RA) modules are available:                    * ra_neon : Module for accessing a repository via WebDAV protocol using Neon.   - handles 'http' scheme * 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

我们在编译neon的时候需要加上参数:--with-ssl=openssl 这样完整的编译完成后,就可以看到:

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.   - handles 'svn' scheme * ra_local : Module for accessing a repository on local disk.   - handles 'file' scheme

3、在安装subversion的时候,make后出现如下报错,原因是在configure的时候没有指定--with-neon参数,导致错误

/usr/local/lib/libneon.a(ne_auth.o): In function `clean_session': /dist/src/neon-0.29.6/src/ne_auth.c:305: undefined reference to `ne__ntlm_destroy_context' /usr/local/lib/libneon.a(ne_auth.o): In function `request_ntlm': /dist/src/neon-0.29.6/src/ne_auth.c:754: undefined reference to `ne__ntlm_getRequestToken' /usr/local/lib/libneon.a(ne_auth.o): In function `ntlm_challenge': /dist/src/neon-0.29.6/src/ne_auth.c:788: undefined reference to `ne__ntlm_authenticate' /dist/src/neon-0.29.6/src/ne_auth.c:781: undefined reference to `ne__ntlm_destroy_context' /dist/src/neon-0.29.6/src/ne_auth.c:785: undefined reference to `ne__ntlm_create_context' collect2: ld returned 1 exit status make: *** [subversion/libsvn_ra_neon/libsvn_ra_neon-1.la] Error 1