歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux管理 >> Linux配置 >> svn安裝與遷移

svn安裝與遷移

日期:2017/2/27 14:59:51   编辑:Linux配置
以下為svn安裝與遷移,遷移非常簡單直接copy庫文件就ok。
#安裝subversion前,須安裝apr和apr-util才能正常工作,系統默認情況下,是已經有apr和apr-util這兩個包的,但版本較低,僅支持subversion 1.4
mkdir /root/svn
cd /root/svn
rpm -e --nodeps apr apr-util
wget http://archive.apache.org/dist/apr/apr-1.4.6.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.4.1.tar.gz
tar xzf apr-1.4.6.tar.gz
tar xzf apr-util-1.4.1.tar.gz
cd apr-1.4.6
./configure --prefix=/usr/local/apr
make && make install
cd ../apr-util-1.4.1
./configure --with-apr=/usr/local/apr
make && make install
cd ../
wget http://www.apache.org/dist//httpd/httpd-2.2.22.tar.gz
tar xzf httpd-2.2.22.tar.gz
cd httpd-2.2.22
./configure --prefix=/usr/local/apache --enable-so --enable-ssl  \
--enable-rewrite --with-mpm=worker --enable-headers --enable-deflate \
--enable-dav --with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-util=/usr/local/apr/bin/apu-1-config -enable-maintainer-mode
make && make install
cp /usr/local/apache/bin/apachectl  /etc/init.d/httpd
sed -i '2a # chkconfig: - 85 15' /etc/init.d/httpd
sed -i '3a # description: Apache server' /etc/init.d/httpd
chmod 755 /etc/init.d/httpd
chkconfig --add httpd
chkconfig httpd on
cd ../

wget http://labs.renren.com/apache-mirror/subversion/subversion-1.7.3.tar.gz
tar xzf subversion-1.7.3.tar.gz
cd subversion-1.7.3[/php]


./configure --prefix=/usr/local/subversion \
--with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-util=/usr/local/apr/bin/apu-1-config --with-ssl --with-zlib --without-berkeley-db --enable-maintainer-mode
#報錯如下
checking sqlite library version (via header)... unsupported SQLite version
checking sqlite library version (via pkg-config)... none or unsupported 3.3
no

An appropriate version of sqlite could not be found.  We recommmend
3.7.6.3, but require at least 3.6.18.
Please either install a newer sqlite on this system

or

get the sqlite 3.7.6.3 amalgamation from:
http://www.sqlite.org/sqlite-amalgamation-3.7.6.3.tar.gz
unpack the archive using tar/gunzip and copy sqlite3.c from the
resulting directory to:
/root/svn/subversion-1.7.3/sqlite-amalgamation/sqlite3.c

configure: error: Subversion requires SQLite
#解決方法:根據報錯提示
cd ../
wget http://www.sqlite.org/sqlite-autoconf-3071000.tar.gz
mkdir subversion-1.7.3/sqlite-amalgamation
tar xzf sqlite-autoconf-3071000.tar.gz
cp sqlite-autoconf-3071000/sqlite3.c subversion-1.7.3/sqlite-amalgamation/
cd subversion-1.7.3
重新編譯,可以忽略DBD警告
[php]./configure --prefix=/usr/local/subversion \
--with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-util=/usr/local/apr/bin/apu-1-config --with-ssl --with-zlib --enable-maintainer-mode
make && make install[/php]



配置subversion
1. 復制賬號密碼、權限認證文件
將賬號密碼(svn_auth_file)、權限認證(svn_access)復制到/data/svn/目錄下
2.修改賬號密碼文件
復制過來的svn_auth_file密碼都是明文應用/usr/local/apache2/bin/Linux/1727.html' target='_blank'>htpasswd /data/svn/svn_auth_file admin,不加密可能不能正常登陸。
3.復制資料庫
將import、repository復制到/data/svn/目錄下

配置apache的httpd.conf
修改apache下的httpd.conf最後增加以下內容。
[php]LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn>
DAV svn
SVNParentPath /data/svn/repository
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /data/svn/svn_auth_file
AuthzSVNAccessFile "/data/svn/svn_access"
Require valid-user
</Location>[/php]



驗證
[php]/usr/local/apache/bin/apachectl –t
Service apache restart
http://192.168.1.110/svn/mjm_repo
Copyright © Linux教程網 All Rights Reserved