您的位置:首页 > 运维架构 > Linux

CentOS中安装SVN服务

2015-03-02 14:52 435 查看

引言

svn(subversion)是近年来崛起的版本管理工具,是cvs的接班人。目前,绝大多数开源软件都使用svn作为代码版本管理软件。如何快速建立Subversion服务器,并且在项目中使用起来,这是大家最关心的问题,与CVS相比,Subversion有更多的选择,也更加的容易,几个命令就可以建立一套服务器环境。[1]

本文主要介绍Subversion最新版本在CentOS系统中的源码安装过程及碰到的一些问题。与在windows下环境下安装相比,linux环境下Subversion的安装往往会因为缺乏相关的依赖包而不能正常安装。本文只列出作者在安装过程碰到的依赖包,读者应视自身的情况而定。

一、环境说明

操作系统:CentoS 6.5

Subversion版本:1.8.11

二、SVN安装

2.1 Subversion源码下载

下载地址:http://subversion.apache.org/download

选择版本:subversion-1.8.11.tar.gz
(注,本文将所有安装过程需要的文件保存在/root/SVN/目录下)

2.2 解压安装Subversion

#cd /root/SVN
#tar -xzf subversion-1.8.11.tar.gz
#cd subversion-1.8.11
#./configure --prefix=/opt/subversion

2.3 configure: error: no suitable APRUTIL found

configure: WARNING: APR not found

The Apache Portable Runtime (APR) library cannot be found.

Please install APR on this system and configure Subversion

with the appropriate --with-apr option.

You probably need to do something similar with the Apache

Portable Runtime Utility (APRUTIL) library and then configure

Subversion with both the --with-apr and --with-apr-util options.

configure: error: no suitable APR found
搜索后发现缺乏apr和apr-util两个依赖包。[2]

2.4 安装apr与apr-util

2.4.1 下载apr与apr-util

下载地址:http://apr.apache.org/

下载版本:apr-1.5.1.tar.gzapr-util-1.5.4.tar.gz

2.4.2 安装apr

#cd /root/SVN
#tar -xzf apr-1.5.1.tar.gz
#cd apr-1.5.1
#./configure --prefix=/opt/apr


出现这个提示:cannot
remove `libtoolT’: No such file or directory

解决方案:编辑
configure文件,查找 $RM "$cfgfile" 这个地方,用#注释掉,然后重新编译安装就可以了。
#make
#make install


2.4.3 安装apr-util

#cd /root/SVN
#tar -xzf apr-util-1.5.4.tar.gz
#cd apr-util-1.5.4
#./configure --prefix=/opt/apr-util
#make #make install

2.5 重新配置subversion

#./configure --prefix=/opt/subversion --with-apr-util=/opt/apr --with-apr=/opt/apr-util

2.5.1 出现提示:configure: error: Subversion requires SQLite 说明缺乏sqlite依赖包[3]

解决方案:

get the sqlite 3.7.15.1 amalgamation from:http://www.sqlite.org/sqlite-amalgamation-3071501.zipunpack the archive using unzip and rename the resultingdirectory to:/RNA-data/software/S01_utilize/subversion-1.8.11/sqlite-amalgamation

下载sqlite-amalgamation-3071501.zip通过unzip解压到subversion-1.8.11/sqlite-amalgamation目录下

再次配置subversion

2.5.2 出现提示:configure: error: subversion requires zlib[4]

解决方案:从http://zlib.net/下载zlib-1.2.8.tar.gz,并安装到/opt/zlib目录。

#cd /root/SVN
#tar -xzf zlib-1.2.8.tar.gz
#cd zlib-1.2.8
#./configure --prefix=/opt/zlib
#make #make install

2.6 重新配置subversion

#./configure --prefix=/opt/subversion --with-apr-util=/opt/apr --with-apr=/opt/apr-util --with-zlib=/opt/zlib
#make
#make install


三、配置环境变量

通过修改profile文件设置环境变量

#vim /etc/profile

#svn
SVN_HOME=/opt/subversion
export PATH=$PATH:$SVN_HOME/bin

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
#source /etc/profile (刷新设置,避免重启)

#echo $PATH(查看设置是否生效)

四、测试安装是否成功

#svnserve --version

svnserve,版本 1.8.11 (r1643975)
编译于 Mar  1 2015,18:34:07 在 i686-pc-linux-gnu

Copyright (C) 2014 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/ 
下列版本库后端(FS) 模块可用:

* fs_fs : 模块与文本文件(FSFS)版本库一起工作。
出现版本信息则安装subversion成功。

参考资料

[1] http://jingyan.baidu.com/article/fec7a1e52ef3721190b4e7a1.html
[2] /article/2186572.html

[3] http://blog.sina.com.cn/s/blog_70b
[4] http://www.cnblogs.com/qinwanlin/archive/2012/12/03/2797339.html2b6020101mznl.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: