svn安装配置

svn在Linux系统上的安装,通过http和https,使用mod_dav_svn访问版本库的安装方法。

1 -- 软件依赖与下载

apache依赖的软件:openssl、apr-util、apr

svn依赖的软件:openssl、apr-util、apr、sqlite、neon

下载各软件链接:
apache:http://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.2.23.tar.gz

apr-util:http://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.5.1.tar.gz

apr:http://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.4.6.tar.gz

openssl:http://openssl.org/source/openssl-1.0.1c.tar.gz

subversion:http://www.fayea.com/apache-mirror/subversion/subversion-1.7.7.tar.gz

sqlite:http://sqlite.org/sqlite-autoconf-3071401.tar.gz

neon:http://www.webdav.org/neon/neon-0.29.6.tar.gz

2 -- 创建运行环境用户以及用户组

该用户将是apache和svn运行时使用的有效用户,创建命令:

$ groupadd svn
$ useradd svn
$ mkdir /home/svn
$ chown -R svn:svn /home/svn

创建用户svn以及用户组svn,该用户以及用户组将用在以后软件编译、路径权限设置以及apache和svn的运行时用户。

3 -- 安装依赖库

STEP01 安装apr

$ tar -zxvf apr-1.4.6.tar.gz
$ cd apr-1.4.6/
$ ./configure --prefix=/home/svn/apps/apr
$ make && make install

STEP02 安装apr-util

$ tar -zxvf apr-util-1.5.1.tar.gz 
$ cd apr-util-1.5.1/
$ ./configure --prefix=/home/svn/apps/apr-util --with-apr=/home/svn/apps/apr/
$ make & make install

STEP03 安装SQLite

$ tar -zxvf sqlite-autoconf-3071401.tar.gz 
$ cd sqlite-autoconf-3071401/
$ ./configure --prefix=/home/svn/apps/sqlite
$ make && make install

STEP04 安装openssl

$ tar -zxvf openssl-1.0.1c.tar.gz
$ cd openssl-1.0.1c/
$ ./config --prefix=/home/svn/apps/ssl shared
$ make && make install

STEP05 安装neon

$ tar -zxvf neon-0.29.6.tar.gz
$ cd neon-0.29.6/
$ ./configure --prefix=/home/svn/apps/neon --with-ssl --with-libs=/home/svn/apps/ssl --enable-shared
$ make && make install

neon并非必要软件,但如果需要通过http或者https协议访问版本库,那就必须安装。我们知道,SVN有ra_dav(http,https)、ra_svn(svn原生协议)、ra_local(本地路径)三种存取模块,系统为我们默认安装了ra_svn和ra_local,我们自己安装neon库,从而让svn支持ra_dav存储模块。下面是不安装neon的情况下,svn的输出:

$ svn --version
The following repository access (RA) modules are available:
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme

当我们正确安装neon,svn已经支持ra_dav之后,执行上述命令应该是如下输出:

$ svn --version
The following repository access (RA) modules are available:
* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
4 -- 安装apache(with https)
$ tar -zxvf httpd-2.2.23.tar.gz
$ cd httpd-2.2.23
$ ./configure --prefix=/home/svn/apps/apache --with-apr=/home/svn/apps/apr --with-apr-util=/home/svn/apps/apr-util --with-ssl=/home/svn/apps/ssl --enable-dav --enable-so --enable-ssl --enable-rewrite
$ make & make install
5 -- 安装svn(with mod_dav_svn)
$ tar -zxvf subversion-1.7.7.tar.gz
$ cd subversion-1.7.7
$ ./configure --prefix=/home/svn/apps/svn --with-apr=/home/svn/apps/apr --with-apr-util=/home/svn/apps/apr-util --with-ssl=/home/svn/apps/ssl  --with-sqlite=/home/svn/apps/sqlite --with-apxs=/home/svn/apps/apache/bin/apxs --with-neon=/home/svn/apps/neon --with-openssl
$ make & make install
6 -- apache&httpd的配置

打开httpd/conf目录下的httpd.conf,找到如下字样处,在其后加入mod_dav_svn以及mod_mysql_auth模块:

# Example:
# LoadModule foo_module modules/mod_foo.so
#

在其后修改成如下:

# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule dav_svn_module  modules/mod_dav_svn.so    
LoadModule authz_svn_module modules/mod_authz_svn.so
原文地址:https://www.cnblogs.com/motadou/p/2370280.html