日期:2014-05-16  浏览次数:21036 次

安装subversion1.8和apache
一.安装apr和apr-uti
wget http://mirror.bit.edu.cn/apache//apr/apr-1.4.8.tar.gz
tar zxvf apr-1.4.8.tar.gz
cd apr-1.4.8
./configure --prefix=/usr/local/apr
make && make install

验证:
#/usr/local/apr/bin/apr-1-config --version
1.4.8

wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.5.2.tar.gz
tar zxvf apr-util-1.5.2.tar.gz
cd apr-util-1.5.2
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
make && make install

验证:
#/usr/local/apr-util/bin/apu-1-config --version
1.5.2

二.安装sqlite3
wget http://www.sqlite.org/2013/sqlite-autoconf-3080000.tar.gz
tar zxvf sqlite-autoconf-3080000.tar.gz
cd sqlite-autoconf-3080000
./configure 
make && make install


三.安装openssl
wget http://www.openssl.org/source/openssl-1.0.1.tar.gz
tar xzvf openssl-1.0.1.tar.gz
cd openssl-1.0.1
./config --prefix=/usr/local/openssl
make && make install


四.安装apache http server 和ssl model
wget http://mirrors.cnnic.cn/apache//httpd/httpd-2.2.25.tar.gz
tar zxvf httpd-2.2.25.tar.gz
export LDFLAGS=-ldl
cd httpd-2.2.25
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr-util/bin/apu-1-config --enable-modules=so --enable-dav --enable-maintainer-mode --enable-rewrite --enable-ssl --with-ssl=/usr/local/openssl
make && make install

设置开机启动
cp  /usr/local/apache2/bin/apachectl /etc/init.d/httpd
#编辑/etc/init.d/httpd,在第二行增加如下内容
#chkconfig: 2345 85 35
chkconfig httpd on


通过service httpd start启动服务,正常情况下会提示启动成功,通过在其他电脑上打开浏览器浏览这台服务器IP的80端口服务,如果出现It works 字样,恭喜您,安装成功

如果出现
httpd: Could not reliably determine the server’s fully qualified domain name,
只需要编辑httpd.conf 将里面的
#ServerName www.example.com:80注释去掉即可,,并改成ServerName 127.0.0.1:80

五.安装zlib
wget  http://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
tar -xvzf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make && make install



六.安装subversion1.8
wget http://mirror.esocc.com/apache/subversion/subversion-1.8.4.tar.gz
tar zxvf subversion-1.8.4.tar.gz
mkdir -p ./subversion-1.8.4/sqlite-amalgamation
cp ./sqlite-autoconf-3080000/sqlite3.c ./subversion-1.8.4/sqlite-amalgamation
cd subversion-1.8.4
./configure --prefix=/opt/svn/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-zlib --enable-maintainer-mode
make && make install

验证:
#/opt/svn/subversion/bin/svnserve --version
svnserve, version 1.8.4 (r1534716)

七、整合Apache
拷贝模块
cp /opt/svn/subversion/libexec/mod_authz_svn.so /usr/local/apache2/modules/
cp /opt/svn/subversion/libexec/mod_dav_svn.so /usr/local/apache2/modules/

编辑http.conf文件
vi /usr/local/apache2/conf/httpd.conf
在最后面增加如下内容
#加载整合svn所需so文件
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<Location />
     DAV  svn
     SVNParentPath /opt/svn/data/      #svn 根目录
     SVNListParentPath On
     SVNAutoversioning On
     SVNReposName "svn"
     AuthzSVNAccessFile /opt/svn/subversion/conf/authz.conf  #目录分组权限
     Auth