linux安装

http://qwqg.mobibal.com/?p=1151

linux下安装subversion
下载:
wget http://labs.xiaonei.com/apache-mirror/httpd/httpd-2.0.63.tar.gz
wget http://subversion.tigris.org/downloads/subversion-1.6.6.tar.bz2
wget http://apache.etoak.com/apr/apr-1.3.8.tar.gz
wget http://apache.etoak.com/apr/apr-util-1.3.9.tar.gz
wget http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.6.tar.bz2

一.安装apr和apr-util
二.安装apache服务器
三. 安装subversion
四. 配置subversion
五. 配置apache的httpd.conf
六. 验证安装

一、安装apr、apr-util
[root@svn apr-1.3.8]# ./configure -prefix=/usr/local/apr && make && make install
[root@svn apr-util-1.3.9]# ./configure -prefix=/usr/local/apr-util -with-apr=/usr/local/apr && make && make install

二、安装apache
[root@svn httpd-2.2.14]# ./configure -prefix=/usr/local/apache2 -enable-so -enable-dav -with-mpm=worker -with-apr=/usr/local/apr/bin/apr-1-config -with-apr-util=/usr/local/apr-util/bin/apu-1-config && make && make install

三、安装subversion
[root@svn subversion-1.6.6]# ./configure -prefix=/usr/local/subversion -with-apxs=/usr/local/apache2/bin/apxs -with-apr=/usr/local/apr/bin/apr-1-config -with-apr-util=/usr/local/apr-util/bin/apu-1-config -with-ssl -with-zlib -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.6.13, but require at least 3.4.0.
Please either install a newer sqlite on this system

or

get the sqlite 3.6.13 amalgamation from:
http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz
unpack the archive using tar/gunzip and copy sqlite3.c from the
resulting directory to:
/root/soft/subversion-1.6.6/sqlite-amalgamation/sqlite3.c
This file also ships as part of the subversion-deps distribution.

configure: error: Subversion requires SQLite

按照以上提示下载sqlite-amalgamation-3.6.13.tar.gz
[root@svn soft]# wget http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz
[root@svn soft]# tar zxvf sqlite-amalgamation-3.6.13.tar.gz
到svn所在目录
[root@svn subversion-1.6.6]# mkdir sqlite-amalgamation
回到sqlite所在目录
[root@svn soft]# cp sqlite-3.6.13/sqlite3.c /root/soft/subversion-1.6.6/sqlite-amalgamation/

再次configure,报错如下:
configure: maintainer-mode: adding GCC warning flags
configure: error: –with-zlib requires an argument.

安装zlib,下载subversion-deps-1.6.6.tar.bz2
[root@svn soft]# wget http://subversion.tigris.org/downloads/subversion-deps-1.6.6.tar.bz2
放在和svn压缩文件在一个目录:
[root@localhost svn]# ll
总计 11840
drwxr-xr-x 10 1000 1000    4096 11-29 13:16 subversion-1.6.17
-rw-r--r--  1 root root 7531891 10-13 18:03 subversion-1.6.17.tar.gz
-rw-r--r--  1 root root 4561963 11-29 13:17 subversion-deps-1.6.17.tar.gz
解压出该包
进入
[root@svn soft]# cd subversion-1.6.6/zlib/

[root@svn zlib]# ./configure –shared
[root@svn zlib]# make

在安装openssl(yum install openssl*)


cd subversion-1.6.12 
因为apr 和 apr-util 都已经安装了所以在subversion-1.6.12 目录下删除上述两个人文件夹 
rm –fr apr 
rm –fr apr-util 
然后再到、usr/local/下创建svn文件夹 
返回之前目录 
安装svn 
./configure --prefix=/usr/local/svn --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1config --with-ssl --with-zlib --enable-maintainer-mode (注意这步出现错误configure: error: no XML parser was found: expat or libxml 2.x required, 原因是没有安装 neon) 
解压的svn 文件里面有neon  
cd /usr/local/subversion-1.5.0/neon 
./configure --with-ssl (注意这步也会出现configure: error: no XML parser was found: expat or libxml 2.x required 这是因为还有一个包没有安装expat 可以 yun install expat* 直接安装, 安装完后在往下惊醒) 
make 
make install 
 
还是到了安装svn 这步 
./configure –prefix=/usr/local/svn --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1config --with-ssl --with-zlib --enable-maintainer-mode 
这时候又会出现问题 zlib 没有 
 
按照以下步骤来做 就行了 
 
1) cd /usr/local/subversion-1.5.0/zlib 
2) ./configure --shared 
3) make 
4) cd .. 
5) ./configure  CPPFLAGS="-Izlib/ -Lzlib/" 
6) make 

./configure --prefix=/usr/local/svn --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=/usr/local/zlib --enable-maintainer-mode


再次configure:
[root@svn subversion-1.6.6]# ./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-util/bin/apu-1-config -enable-maintainer-mode -with-ssl CPPFLAGS="-Izlib/ -Lzlib/"

报如下BDB WARNING:
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.oracle.com/technology/software/products/berkeley-db/index.html

[root@svn subversion-1.6.6]# make && make install

四、配置subversion
1. 创建账号密码文件
htpasswd –c /data/svn/passwd.conf apache
输入密码,两次确认
注意:第一次设置用户密码要加入 –c 这个参数
2. 创建资料库
svnadmin create /data/svn/svnroot
到svnroot下看是不是多了文件,多了就是说明创建成功

五、配置apache的httpd.conf
打开apache的conf/httpd.conf,安装subversion后,apache的conf/httpd.conf文件会自动增加模块
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

相应的so文件也自动copy到了apache/modules。这些工作就不用自己动手了。

需要自己动手修改apache下的httpd.conf最后增加以下内容

DAV svn
SVNPath /data/svn/svnroot
AuthType Basic
AuthName “Subversion repository”
AuthUserFile /data/svn/passwd.conf
Require valid-user

http://192.168.0.114/svn/
svn – Revision 0: /

你可能感兴趣的:(linux)