linux下svn的安裝

以Red Hat Enterprise Linux 5爲例進行講解。java

 

相關係列:linux

linux下jdk的安裝nginx

linux下ant的安裝redis

linux下redis的安裝服務器

linux下svn的安裝網絡

linux下nginx的安裝編輯器

linux下graphviz的安裝svn

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 文件名稱來解決

雖然解決了,不過仍是不明因此。

相關文章
相關標籤/搜索