Subversion(簡(jiǎn)稱svn)是近年來崛起的版本管理軟件系統(tǒng),是cvs的接班人。目前,絕大多數(shù)開源軟件都使用svn作為代碼版本管理軟件。
Subversion是一個(gè)版本控制系統(tǒng),相對(duì)于的RCS、CVS,采用了分支管理系統(tǒng),它的設(shè)計(jì)目標(biāo)就是取代CVS?;ヂ?lián)網(wǎng)上免費(fèi)的版本控制服務(wù)多基于Subversion。
Subversion的版本庫(kù)可以通過網(wǎng)絡(luò)訪問,從而使用戶可以在不同的電腦上進(jìn)行操作。從某種程度上來說,允許用戶在各自的空間里修改和管理同一組數(shù)據(jù)可以促進(jìn)團(tuán)隊(duì)協(xié)作。因?yàn)樾薷牟辉偈菃尉€進(jìn)行(單線進(jìn)行也就是必須一個(gè)一個(gè)進(jìn)行),開發(fā)進(jìn)度會(huì)進(jìn)展迅速。此外,由于所有的工作都已版本化,也就不必?fù)?dān)心由于錯(cuò)誤的更改而影響軟件質(zhì)量—如果出現(xiàn)不正確的更改,只要撤銷那一次更改操作即可。某些版本控制系統(tǒng)本身也是軟件配置管理系統(tǒng)(SCM),這種系統(tǒng)經(jīng)過精巧的設(shè)計(jì),專門用來管理源代碼樹,并且具備許多與軟件開發(fā)有關(guān)的特性—比如,對(duì)編程語言的支持,或者提供程序構(gòu)建工具。不過Subversion并不是這樣的系統(tǒng)。它是一個(gè)通用系統(tǒng),可以管理任何類型的文件集。
Subversion 1.8中http客戶端基于neon已經(jīng)被移除,改用self。如果要支持http方式需要在安裝svn前安裝serf,安裝serf推薦用serf-1.2.1,安裝是./configure;serf-1.3.0安裝是用scons(yum -y install scons)方式,安裝serf-1.3.0后安裝可能會(huì)報(bào)誤,Google沒找到解決方法,如下報(bào)錯(cuò)
checking for serf-2 library... no
checking for serf-1 library... no
checking was serf enabled... no
An appropriate version of serf could not be found, so libsvn_ra_serf
will not be built. If you want to build libsvn_ra_serf, please
install serf 1.2.1 or newer.
configure: error: Serf was explicitly enabled but an appropriate version was not found.
安裝步驟:
(本文只基于LAMP一鍵安裝包環(huán)境部署好之后進(jìn)行)
1. 安裝apr、apr-unit
cd /root/lamp/source
#wget http://archive.apache.org/dist/apr/apr-1.4.8.tar.gz #LAMP中已經(jīng)下載
#wget http://archive.apache.org/dist/apr/apr-util-1.5.2.tar.gz
tar xzf apr-1.4.8.tar.gz
cd apr-1.4.8
./configure --prefix=/usr/local/apache
make make install
cd ../
tar xzf apr-util-1.5.2.tar.gz
cd apr-util-1.5.2
./configure --prefix=/usr/local/apache
make make install
cd ../
2. 安裝serf-1.2.1
yum -y install expat-devel
wget http://serf.googlecode.com/files/serf-1.2.1.tar.bz2 #serf-1.2.1.zip是win版有問題
tar xjf serf-1.2.1.tar.bz2
cd serf-1.2.1
./configure --prefix=/usr/local/serf --with-apr=/usr/local/apache --with-apr-util=/usr/local/apache
make make install
cd ..
3. 安裝svn
tar xzf subversion-1.8.1.tar.gz
cd subversion-1.8.1
./get-deps.sh
./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache/bin/apxs \
--with-apr=/usr/local/apache --with-apr-util=/usr/local/apache --with-zlib \
--with-openssl --enable-maintainer-mode --with-serf=/usr/local/serf --enable-mod-activation
make make install
cd ..
4. 檢查是否安裝成功
安裝成功會(huì)在/usr/local/apache/conf/httpd.conf自己加入下面2行
LoadModule dav_svn_module /usr/local/subversion/libexec/mod_dav_svn.so
LoadModule authz_svn_module /usr/local/subversion/libexec/mod_authz_svn.so
檢查svn是否支持http方式:
# svn --version
svn, version 1.8.1 (r1503906)
compiled Aug 2 2013, 11:36:48 on x86_64-unknown-linux-gnu
Copyright (C) 2013 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/
The following repository access (RA) modules are available:
* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- 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