为了复制方便,我是在虚拟机Vmware最简化安装Centos 7.6进行实验的。 不能连网的环境,也可以搭个yum源或用源码去安装
到官网去下载apache和svn及其依赖包:
https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.39.tar.bz2 #Apache,很火的Web服务器软件
https://mirrors.tuna.tsinghua.edu.cn/apache/subversion/subversion-1.12.0.tar.bz2 #Subversion(简称SVN),版本管理软件
https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.7.0.tar.bz2 #apr中包含了一些通用的开发组件,apache依赖
https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.6.1.tar.bz2 #apr-util也是包含了一些常用的开发组件,apache/svn依赖
https://sqlite.org/2019/sqlite-autoconf-3280000.tar.gz #SQLite一款轻量级开源数据库,svn依赖
https://www.openssl.org/source/openssl-1.1.1b.tar.gz #https加密用的,apache依赖
https://nchc.dl.sourceforge.net/project/scons/scons/3.0.5/scons-3.0.5.tar.gz #安装新版serf需要用到
https://www.apache.org/dist/serf/serf-1.3.9.tar.bz2 #不是必要软件,如需通过http/https协议访问版本库才要安装
Subversion有ra_dav(http,https)、ra_svn(svn原生协议)、ra_local(本地路径)三种存取模块,默认安装了ra_svn和ra_local。如需svn支持ra_dav存储模块,需要我们自己在安装svn前安装serf(旧版本subversion的http/https客户端基于neon,1.8版本后改用serf)。serf-1.3.0之前的版本,源码安装是“configure”配置->“make”编译->"make install"安装;但serf-1.3.0之后的版本安装是用scons方式
方法一:
直接yum安装svn和https及所依赖的模块,然后进行相关配置配置
yum -y install subversion mod_dav_svn httpd httpd-devel openssl mod_ssl
openssl是一个函数库,mod_ssl是apache的一个扩展模块,该模块依赖openssl。貌似新的apache自带了ssl,不需另外安装
方法二:
源码安装
1、安装apr
[root@localhost ~]# mkdir -p /software/tools
[root@localhost ~]# cd /software/tools/
[root@localhost tools]# rz #从本机传安装包到虚拟机
rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring apr-1.6.5.tar.bz2...
100% 835 KB 835 KB/sec 00:00:01 0 Errors
Transferring apr-util-1.6.1.tar.bz2...
100% 418 KB 418 KB/sec 00:00:01 0 Errors
Transferring httpd-2.4.39.tar.bz2...
100% 6865 KB 6865 KB/sec 00:00:01 0 Errors
Transferring openssl-1.1.1b.tar.gz...
100% 8021 KB 8021 KB/sec 00:00:01 0 Errors
Transferring sqlite-autoconf-3280000.tar.gz...
100% 2744 KB 2744 KB/sec 00:00:01 0 Errors
Transferring subversion-1.12.0.tar.bz2...
100% 8305 KB 8305 KB/sec 00:00:01 0 Errors
[root@localhost tools]# ls
apr-1.6.5.tar.bz2 apr-util-1.6.1.tar.bz2 httpd-2.4.39.tar.bz2 openssl-1.1.1b.tar.gz sqlite-autoconf-3280000.tar.gz subversion-1.12.0.tar.bz2
[root@localhost tools]# tar -jxf apr-1.6.5.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now #报错,解压依赖bzip2
[root@localhost tools]# yum update
[root@localhost tools]# yum install bzip2 -y #yum更新bzip2,或下载源码安装
......
[root@localhost tools]# tar -jxf apr-1.6.5.tar.bz2
[root@localhost tools]# cd apr-1.6.5
[root@localhost apr-1.6.5]# ./configure --prefix=/software/apr #configure命令生成Makefile,为下一步的编译做准备。prefix安装软件到指定路径
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
Configuring APR library
Platform: x86_64-pc-linux-gnu
checking for working mkdir -p... yes
APR Version: 1.6.5
checking for chosen layout... apr
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/software/tools/apr-1.6.5':
configure: error: no acceptable C compiler found in $PATH #没找到依赖的gcc
See `config.log' for more details
[root@localhost apr-1.6.5]# yum install gcc -y
...... #检查结果没报错
[root@localhost apr-1.6.5]# ./configure --prefix=/software/apr
...... #检查结果没报错
[root@localhost apr-1.6.5]# make #从Makefile中读取指令,然后编译。
...... #检查结果没报错
[root@localhost apr-1.6.5]# make install #从Makefile中读取指令安装到指定的位置。
...... #检查结果没报错
[root@localhost apr-1.6.5]# ls /software/apr #检查下安装目录是否存在了
bin build-1 include lib
2、安装apr-util
[root@localhost tools]# tar -jxf apr-util-1.6.1.tar.bz2
[root@localhost tools]# cd apr-util-1.6.1
[root@localhost apr-util-1.6.1]# ./configure --prefix=/software/apr-util --with-apr=/software/apr/ #--with-apr= 指定上一步安装apr路径
...... #检查没报错
[root@localhost apr-util-1.6.1]# make
......
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory #有报错,缺少expat库
#include <expat.h>
^
compilation terminated.
make[1]: *** [xml/apr_xml.lo] Error 1
make[1]: Leaving directory `/software/tools/apr-util-1.6.1'
make: *** [all-recursive] Error 1
[root@localhost apr-util-1.6.1]# yum install expat-devel -y
...... #检查没报错
[root@localhost apr-util-1.6.1]# make
...... #检查没报错
[root@localhost apr-util-1.6.1]# make install
...... #检查没报错
[root@localhost apr-util-1.6.1]# ls /software/apr-util/ #检查下安装目录是否存在了
bin include lib
[root@localhost apr-util-1.6.1]#
3、安装sqlite
[root@localhost tools]# tar -zxf sqlite-autoconf-3280000.tar.gz
[root@localhost tools]# cd sqlite-autoconf-3280000
[root@localhost sqlite-autoco