最近上头安排了帮客户安装svn服务器,用了两种方式安装,yum命令安装,快速简洁容易上手,但是源码安装就比较繁琐,两种方式都试了一下,yum命令基本一个多小时就安装完了,但是源码安装弄了我两天的时间,比较蛋疼,看了网上很多的博文,踩了很多坑,最后也安装成功了,所就分享给有需要的人。
一、环境说明
操作系统:CentoS 7
Subversion版本:1.8.15
二、SVN安装
2.1 Subversion源码下载
下载地址:
选择版本:subversion-1.8.15.tar.gz (注,本文将所有安装过程需要的文件保存在/usr/local/java/svn目录下)
2.2 解压安装Subversion
#cd /usr/local/java/svn #tar -zxvf subversion-1.8.15.tar.gz #cd subversion-1.8.15 #./configure --prefix=/usr/local/subversion2.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.4 安装apr与apr-util
(以下的依赖软件包都传到/usr/local/java/svn/dependPackage/下,并且在这个目录下解压)
2.4.1 下载apr与apr-util
下载地址:
下载版本:apr-1.5.2.tar.gz apr-util-1.6.1.tar.gz
2.4.2 安装apr
出现这个提示:cannot remove `libtoolT’: No such file or directory
解决方案:编辑 configure文件,查找 $RM "$cfgfile" 这个地方,用#注释掉,然后重新编译安装就可以了。
2.4.3 安装apr-util
#cd /usr/local/java/svn/dependPackage #tar -zxvf apr-util-1.6.1.tar.gz #cd apr-util-1.6.1 # ./configure --prefix=/usr/local/apr-uti --with-apr=/usr/local/apr #make #make install2.5 重新配置subversion(每次重新配置都要回到subversion-1.8.15目录下)
#./configure --prefix=/usr/local/subversion --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util2.5.1 出现提示:configure: error: Subversion requires SQLite 说明缺乏sqlite依赖包
解决方案:
get the sqlite 3.7.15.1 amalgamation from: 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.15/sqlite-amalgamation目录下
再次配置subversion
2.5.2 出现提示:configure: error: subversion requires zlib
解决方案:从下载zlib-1.2.8.tar.gz,并安装到/usr/local/zlib目录。
2.6 重新配置subversion
#./configure --prefix=/usr/local/subversion --with-apr-util=/usr/local/apr-util --with-apr=/usr/local/apr --with-zlib=/usr/local/zlib #make #make install三、配置环境变量
通过修改profile文件设置环境变量
#vi /etc/profile
四、测试安装是否成功
#svnserve --version
出现版本信息则安装subversion成功。
五SVN版本库的建立
A.我选择的目录是 /home/svn/作为SVN版本库的根目录,命令为:
# mkdir /home/svnB.比如,现在我有一个名为“project”的项目需要用SVN做版本管理,那么我可以在svn根目录下建立一个 /project目录,我最终目的想让项目托管到/project目录下。接下来我需要新建这个目录:/home/svn/project
,命令为:
C.然后需要将/project目录设定为版本库,命令如下:
# svnadmin create /home/svn/project郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。