以Red Hat Enterprise Linux 5为例进行讲解。java
相关系列:linux
linux下jdk的安装nginx
linux下ant的安装redis
安装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 文件名称来解决
虽然解决了,不过仍是不明因此。