`
hanqunfeng
  • 浏览: 1526157 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

linux下svn的安装

阅读更多

以Red Hat Enterprise Linux 5为例进行讲解。

 

相关系列:

linux下jdk的安装

linux下ant的安装

linux下redis的安装

linux下svn的安装

linux下nginx的安装

linux下graphviz的安装

linux下doxygen的安装

 

 

安装svn版本为1.6.1

一。下载svn

下载地址:http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260&expandFolder=74

选择subversion-1.6.1.tar.gz 和 subversion-deps-1.6.1.tar.gz

将该下载包拷贝到/usr/local/下(随意了,找个地方就好)

 

二。安装

cd /usr/local/

tar zxvf subversion-1.6.1.tar.gz

tar zxvf subversion-deps-1.6.1.tar.gz #会自动解压到subversion-1.6.1下
cd subversion-1.6.1

 

按照一些网络资料的介绍,执行如下命令即可完成安装

./configure

make

make install

 

但在实际安装过程中会,执行./configure时,根据系统的配置不同会有不同的错误提示,我使用的是一个全新安装的系统,主要配置如下:

桌面环境:GNOME桌面环境

应用程序:图形,图形化互联网,

编辑器开发 : 只选择开发工具

服务器:万维网服务器

基本系统:java ,X窗口系统,基本,拨号联网支持,管理工具,系统工具。

语言支持:中文支持

 

接下来我把我遇到的错误提示和解决方法说明如下:

./configure

#错误提示1#

configure: error: We require OpenSSL; try --with-openssl

 

解决方法:

错误提示需要安装openssl,所以我就安装了一个openssl,安装方法如下:

cd /usr/local

wget http://www.openssl.org/source/openssl-1.0.0a.tar.gz

tar -zxvf openssl-1.0.0a.tar.gz

cd openssl-1.0.0a

./config
./config -t
make depend
make
make test
make install

 

安装之后会在/usr/local下生成一个ssl目录

设置环境变量,在/etc/profile的PATH中增加如下内容:

PATH=/usr/local/ssl/bin:/sbin/:$PATH:/usr/sbin
export PATH

 

ok,错误提示1解决。

 

重新执行./configure --with-openssl=/usr/local/ssl #这里加上--with-openssl参数

#错误提示2#

configure: error: subversion requires zlib

 

解决方法:

cd /usr/local

wget  http://zlib.net/zlib-1.2.5.tar.gz
tar -xvzf zlib-1.2.5.tar.gz
cd zlib-1.2.5
./configure
make
make install

 

cd /usr/local

ln -s zlib-1.2.5 zlib

 

ok,错误提示2解决。

 

重新执行./configure --with-openssl=/usr/local/ssl --with-zlib=/usr/local/zlib ,成功!

 

接着执行如下命令:

make

make install

 

ok,svn安装完成。

 

 

 

 

 

 

三。验证

 svn --version

 

有可能会出现如下提示:

svn: error while loading shared libraries: /usr/local/serf/lib/libserf-0.so.0: cannot restore segment prot after reloc: Permission denied

 

此时执行如下命令即可解决问题:

setenforce permissive

 

说明:这是权限配置问题,关于这部分可以参考:http://blog.csdn.net/venoy4806/archive/2009/10/13/4665097.aspx

 

再次执行svn --version

 root@localhost svn]# svn --version
svn, version 1.6.1 (r37116)
   compiled Jun 17 2010, 14:59:48

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

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
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - handles 'http' scheme
  - handles 'https' scheme

 

ok,svn配置完成。

 

测试一下:

svn checkout https://xxx.xxx.xxx/

结果报如下错误:svn: SSL is not supported

仔细一看,原因如下,svn --version显示,ra_neon 不支持https :

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme

从网上查了一下,说是在执行./configure 时要加上--with-ssl

ok,重新安装,如下:

./configure --with-openssl=/usr/local/ssl --with-zlib=/usr/local/zlib --with-ssl

 

错误提示:

configure: error: could not find library containing RSA_new

 

应该是类库的路径不对,那么我们就指定类库路径,如下:

./configure --with-openssl=/usr/local/ssl --with-zlib=/usr/local/zlib --with-ssl --with-libs=/usr/local/ssl

 

ok,这次执行成功,接着执行make,make install 即可。

 

现在再次执行svn --version,显示如下:

[wap@localhost boss]$ svn --version
svn, version 1.6.1 (r37116)
   compiled Jun 17 2010, 14:59:48

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

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
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - handles 'http' scheme
  - handles 'https' scheme

 

可以看到,现在https也支持了。

 

这次执行

svn checkout https://xxx.xxx.xxx/

 

成功。

 

四。后记

总的来说svn的安装还是有些复杂的,为了安装方便我使用的是root用户。

另外在安装过程中可能会遇到如下错误提示:

configure: error: no suitable apr found 和configure: error: Subversion requires SQLite

这是因为没有加入subversion-deps-1.6.1.tar.gz的原因,subversion-deps-1.6.1.tar.gz中包含了在安装svn是必要的一些包,注意下载时两者的版本要一致。

 

 

 

PS:

遇到过这样一个问题,执行svn --version报如下异常:

svn: error while loading shared libraries: /usr/local/serf/lib/libserf-0.so.0: cannot restore segment prot after reloc: Permission denied

 

不明所以,用的好好地突然就这样了,到网上了解了一下,给出解决方法:

编辑/etc/selinux/config,找到这段:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing

把 SELINUX=enforcing 注释掉:#SELINUX=enforcing ,然后新加一行为:

SELINUX=disabled
保存,关闭。

 chcon -t texrel_shlib_t /usr/local/serf/lib/libserf-0.so.0

貌似关于这样的问题都可以通过执行chcon -t texrel_shlib_t 文件名称来解决

虽然解决了,不过还是不明所以。

 

分享到:
评论
1 楼 安静听歌 2016-03-09  

相关推荐

Global site tag (gtag.js) - Google Analytics