CentOS 5.5 安裝配置獨立SVN服務器

本文大部分工作參考:http://blog.hexu.org/archives/405.shtml

1. 下載subversion安裝包之後解壓 進入subversion目錄

wget "http://subversion.tigris.org/downloads/subversion-1.6.12.tar.gz"
wget "http://subversion.tigris.org/downloads/subversion-deps-1.6.12.tar.gz"
tar xfvz subversion-1.6.12.tar.gz
tar xfvz subversion-deps-1.6.12.tar.gz
cd subversion-1.6.12

2. 編譯
./configure -–prefix=/usr/local/svn -–without-berkeley-db
此處可能存在的錯誤:
checking openssl/opensslv.h usability... no
checking openssl/opensslv.h presence... no
checking for openssl/opensslv.h... no
configure: error: We require OpenSSL; try --with-openssl
configure failed for serf
此時先檢查本機有沒有裝 openssl 和 openssl-devel
最簡單的方法就是找一下有沒有opensslv.h這個文件
find / -name opensslv.h
如果能找到,就在configure命令之後添加 --with-openssl= ...(此處是opensslv.h所在的目錄) 我本機是在/usr/include/openssl/下
如果找不到,就執行
yum install openssl
yum install openssl-devel
進行安裝 安裝之後找到opensslv.h所在的目錄加到configure命令之後

./configure -–prefix=/usr/local/svn -–without-berkeley-db --with-openssl=/usr/include/openssl

注:以svnserve方式運行,不加apache編譯參數。以fsfs格式存儲版本庫,不編譯berkeley-db

如果最後出現下面WARNING,我們直接忽略即可。因爲不使用BDB存儲。
configure: WARNING: we have configured without BDB filesystem support

You don't seem to have Berkeley DB version 4.0.14 or newer
installed and linked to APR-UTIL. We have created Makefiles which
will build without the Berkeley DB back-end; your repositories will
use FSFS as the default back-end. You can find the latest version of
Berkeley DB here:

http://www.sleepycat.com/download/index.shtml

3.編譯之後的安裝
#make && makeinstall

爲避免出現以下錯誤
error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory

執行以下操作:
1、編輯/etc/ld.so.conf文件:
#vi /etc/ld.so.conf
添加下面一行
/usr/local/lib
    
2、保存後運行ldconfig。
#/sbin/ldconfig

3、再重新運行make install 問題得到解決。
#make install

注:ld.so.conf和ldconfig用於維護系統動態鏈接庫

至此,安裝完成,執行以下命令測試
# /usr/local/svn/bin/svnserve --version


爲了方便下操作,下面將SVN的BIN添加到PATH
#vi /etc/profile
PATH=/usr/local/svn/bin:$PATH

保存後,使其立即生效
#source /etc/profile
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章