原文地址(ttlsa运维生存时间):http://www.ttlsa.com/archives/723
http://blog.csdn.net/colinchan/article/details/1865154
軟件獲取地址
apache下載地址
http://httpd.apache.org/
subversion下載地址
http://subversion.tigris.org/
apr下載地址
http://apr.apache.org/
sqllite下載地址
http://www.sqlite.org/download.html
一、準備工作
# mkdir -P /usr/local/src/{tarbag,software}
# cd /usr/local/src/tarbag
apache-2.2.21
# wget http://mirror.bjtu.edu.cn/apache//httpd/httpd-2.2.21.tar.gz
subversion-1.7.2
# wget http://mirror.bjtu.edu.cn/apache/subversion/subversion-1.7.2.tar.gz
apr-1.4.5
# wget http://labs.renren.com/apache-mirror//apr/apr-1.4.5.tar.gz
apr-util-1.3.12
# wget http://labs.renren.com/apache-mirror//apr/apr-util-1.3.12.tar.gz
sqllite-3.7.9
# wget http://www.sqlite.org/sqlite-autoconf-3070900.tar.gz
二、安裝Apache
由於本篇重點講解svn安裝配置,如果Apache安裝有疑問的可參見:
這裡重點講解與SVN有關的參數
如果有安裝過apache,使用如下命令查看
# apachectl -M | grep dav
如下所示,即可跳過
dav_module (shared)
dav_fs_module (shared)
Syntax OK
如果沒有則需要重新編譯apache
# ./configure --enable-dav --enable-dav-fs
# make
# make install
三、安裝Apr和Apr-util
# cd /usr/local/src/tarbag/
# tar zxvf apr-1.4.5.tar.gz -C ../software/
# tar zxvf apr-util-1.3.12.tar.gz -C ../software/
# cd ../software/
# cd apr-1.4.5/
# ./configure --prefix=/usr/local/apr/ && make && make install
# cd ../apr-util-1.3.12/
# ./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr/ && make && make install
四、安裝Sqllite
# cd /usr/local/src/tarbag/
# tar zxvf sqlite-autoconf-3070900.tar.gz -C ../software/
# cd ../software/sqlite-autoconf-3070900/
# ./configure --prefix=/usr/local/sqllite && make && make install
五、安裝Subversion
# cd /usr/local/src/tarbag/
# tar zxvf subversion-1.7.2.tar.gz -C ../software/
# cd ../software/subversion-1.7.2/
# ./configure --with-apxs=/usr/local/apache2.2.21/bin/apxs --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-sqllite=/usr/local/sqllite/ && make && make install
六、相關配置
1、配置subversion
拷貝相關類庫
# cd /usr/local/src/software/subversion-1.7.2/
# cp ./subversion/mod_dav_svn/.libs/mod_dav_svn.so /usr/local/apache2.2.21/modules/
# cp ./subversion/mod_authz_svn/.libs/mod_authz_svn.so /usr/local/apache2.2.21/modules/
添加svn的驗證文件svn-auth.conf
# /usr/local/apache2.2.21/bin/htpasswd -cm /data/svn/svn-auth.conf tonyty163
New password:
Re-type new password:
Adding password for user tonyty163
注:只有第一次需要加-c參數,後期再添加用戶千萬不能加-c,否則會將原文件覆蓋的,如下:
# /usr/local/apache2.2.21/bin/htpasswd -m /data/svn/svn-auth.conf admin
New password:
Re-type new password:
Adding password for user admin
配置svn權限控制文件svn-access.conf
[groups]
admin = admin, tonyty163
developers = tonyty163
# Default access rule for ALL repositories
# Everyone can read, admins can |