centos7源码搭建subversion-1.11.1

环境说明

服务器地址:192.168.92.75

搭建用户:www

用户权限:sudo免密,特殊命令不可以使用。

 

一.下载安装包,安装基本环境。

$ mkdir /data/package && cd /data/package
$ wget http://mirror.rise.ph/apache/subversion/subversion-1.11.1.tar.gz
$ tar -xf subversion-1.11.1.tar.gz

$ sudo yum -y install gcc openssl openssl-devel expat apr-devel apr-util-devel unzip # 安装依赖

$ wget https://www.sqlite.org/2019/sqlite-amalgamation-3270200.zip
$ unzip sqlite-amalgamation-3270200.zip
$ mv sqlite-amalgamation-3270200 subversion-1.11.1/sqlite-amalgamation

二.安装svn

$ cd /data/package/subversion-1.11.1/
$ ./configure --prefix=/data/soft/svn --with-lz4=internal --with-utf8proc=internal
$ make -j 4 && make install

$ cd /data/soft/svn/
$ ./bin/svnserve --version   # 查看版本

$ echo 'export PATH=$PATH:/data/soft/svn/bin' >> ~/.bashrc
$ source ~/.bashrc   # 配置环境变量

三.建立一个仓库

$ mkdir /data/www/svn
$ cd /data/www/svn
$ svnadmin create /data/www/svn/

# 修改配置文件
$ echo 'admin = admin' >> conf/authz
$ sed -i 's/# anon-access = read/anon-access = none' conf/svnserve.conf
$ sed -i 's/# auth-access = write/auth-access = write/' conf/svnserve.conf
$ sed -i 's/# password-db = passwd/password-db = passwd/' conf/svnserve.conf
$ sed -i 's/# authz-db = authz/authz-db = authz/' conf/svnserve.conf
$ echo -e "[/]\nadmin = rw\n* =" >> conf/authz

$ grep -Ev '^$|^#' conf/svnserve.conf
[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
[sasl]

$ svnserve -d -r /data/www/svn/   # 启动svn
$ sudo netstat -nutpl|grep svn
tcp        0      0 0.0.0.0:3690            0.0.0.0:*               LISTEN   89033/svnserve

 

排错方案

错误一

You probably need to do something similar with the Apache
Portable Runtime Utility (APRUTIL) library and then configure
Subversion with both the --with-apr and --with-apr-util options.

configure: error: no suitable APR found

 

解决方案

$ sudo yum -y install apr-devel apr-util-devel

 

错误二

get the sqlite 3.8.11.1 amalgamation from:
    https://www.sqlite.org/2015/sqlite-amalgamation-3081101.zip
unpack the archive using unzip and rename the resulting
directory to:
/data/package/subversion-1.11.1/sqlite-amalgamation

configure: error: Subversion requires SQLite

 

解决方案

$ wget https://www.sqlite.org/2019/sqlite-amalgamation-3270200.zip
$ unzip sqlite-amalgamation-3270200.zip
$ mv sqlite-amalgamation-3270200 subversion-1.11.1/sqlite-amalgamation

错误三

checking for utf8proc_version in -lutf8proc... no
configure: error: Subversion requires UTF8PROC

 

解决方案

添加编译参数:--with-utf8proc=internal

 

错误四

3690端口被占用

 

解决方案:启动svn时加上参数:--listen-port 3391

你可能感兴趣的:(svn)