SVN安装:
我采用的是目前当前网站发布的版本:subversion-1.7.3
首先,需要安装预先安装四个组件,你的subversion才能正常工作。
-本文假定apahce已经安装!
-系统在 默认情况下,是已经有apr-util及apr这两个包的,只不过他们的版本较低,只支持subversion 1.4
因此,具体可以看看:
# rpm -qa | grep apr
apr-util-1.2.7-7.el5_3.2
apr-util-1.2.7-7.el5_3.2
apr-1.2.7-11.el5_3.1
xorg-x11-drv-dynapro-1.1.0-2
apr-1.2.7-11.el5_3.1
-
而subversion要求较高的版本,为此,我们需要删除系统自带的apr,apr-util这两个包!强行删掉!
# rpm -e --allmatches apr-util
error: Failed dependencies:
libaprutil-1.so.0()(64bit) is needed by (installed) subversion-1.4.2-4.el5_3.1.x86_64
libaprutil-1.so.0()(64bit) is needed by (installed) httpd-2.2.3-31.el5.centos.x86_64
libaprutil-1.so.0 is needed by (installed) subversion-1.4.2-4.el5_3.1.i386
# rpm -e --allmatches apr-util --nodeps
# rpm -e --allmatches apr --nodeps
.
.如果你没有执行以上步骤,你在安装完成后,你会发现你执行相关的命令都会报错!
# svnadmin create /data/svn/repos1
svnadmin: symbol lookup error: /usr/local/svn/lib/libsvn_subr-1.so.0: undefined symbol: apr_atomic_xchgptr
# svnserve --version
svnserve: symbol lookup error: /usr/local/svn/lib/libsvn_subr-1.so.0: undefined symbol: apr_atomic_xchgptr
apr-1.4.6.tar.gz
apr-util-1.3.8.tar.bz2
neon-0.29.6.tar.gz
sqlite-amalgamation(sqlite-autoconf-3071000.tar.gz)
# tar -xzf apr-1.4.6.tar.gz
# cd apr-1.4.6
# ./configure --prefix=/usr/local/apr
# make && make install
# echo "/usr/local/apr/lib/" >> /etc/ld.so.conf
# ldconfig
# wget http://archive.apache.org/dist/apr/apr-util-1.3.8.tar.bz2
# tar -xjf apr-util-1.3.8.tar.bz2
# cd apr-util-1.3.8
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
# make && make install
# echo "/usr/local/apr-util/lib" >> /etc/ld.so.conf
# ldconfig
安装中发出没找到neon,虽然编译的时候没有中断报错,但为了使用上的便利性,还是安装吧!
# wget http://www.webdav.org/neon/neon-0.29.6.tar.gz
# tar -xzf neon-0.29.6.tar.gz
# cd neon-0.29.6
# ./configure --prefix=/usr/local/neon
# make && make install
# echo "/usr/local/neon/lib" >> /etc/ld.so.conf
# ldconfig
还要安装一个sqlite
编译svn的时候,提示:
有两个方法:一要么安装新的版本,二要么替换文件!
An appropriate version of sqlite could not be found. We recommmend
3.7.6.3, but require at least 3.6.18.
Please either install a newer sqlite on this system
or
get the sqlite 3.7.6.3 amalgamation from:
http://www.sqlite.org/sqlite-amalgamation-3.7.6.3.tar.gz
unpack the archive using tar/gunzip and copy sqlite3.c from the
resulting directory to:
/root/subversion-1.7.3/sqlite-amalgamation/sqlite3.c
备注:
sqlite-amalgamation 这目录在subversion-1.7.3下是没有的,觉得很奇怪,Google后发
现要自己建立。
提示中的地址已经找不到了!
# mkdir /root/subversion-1.7.3/sqlite-amalgamation
# wget http://www.sqlite.org/sqlite-autoconf-3071000.tar.gz
# tar -xzf sqlite-autoconf-3071000.tar.gz
# cd sqlite-autoconf-3071000
# cp sqlite3.c /root/subversion-1.7.3/sqlite-amalgamation/
再次开始编译!
# ./configure --prefix=/usr/local/svn --with-apr=/usr/local/apr --with-apr-
util=/usr/local/apr-util --with-neon=/usr/local/neon
这个警告,无所谓的,只是告诉你Berkeley DB已不再被支持了。
You don't seem to have Berkeley DB version 4.0.14 or newer
installed and linked to APR-UTIL. We have created Makefile which will build
Subversion without support for the Berkeley DB back-end. You can find the
latest version of Berkeley DB here:
# make && make install
# echo "/usr/local/svn/lib" >> /etc/ld.so.conf
# ldconfig
-此时,可以看下apache是否有生成相应的模块!
# ls /usr/local/apache/modules/ | grep svn
mod_authz_svn.so
mod_dav_svn.so
# /usr/local/svn/bin/svn --version
svn, version 1.7.3 (r1242825)
compiled Feb 22 2012, 17:29:06
Copyright (C) 2012 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
* 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
安装成功了!