环境准备:
将之前安装的Apache卸载
rpm -q httpd
rpm -e httpd
rpm -e httpd --nodeps
1、安装依赖包apr
依赖包下载地址:
http://archive.apache.org/dist/apr/
apr-1.5.2.tar.bz2
apr-util-1.5.4.tar.bz2
2、安装httpd软件
版本:httpd-2.4.39.tar.bz2
1)下载
https://httpd.apache.org/download.cgi#apache24
2)解压
[root@localhost soft]# tar -xf httpd-2.4.39.tar.bz2 -C /usr/src/
3)安装(解压目录)
配置
[root@localhost httpd-2.4.39]# vim apache.sh
[root@localhost httpd-2.4.39]# cat apache.sh
./configure \
--enable-modules=all \
--enable-mods-shared=all \
--enable-so \
--enable-rewrite \
--with-mpm=prefork \
--with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-util=/usr/local/apr/bin/apu-1-config
[root@localhost httpd-2.4.39]#
执行配置
[root@localhost httpd-2.4.39]# bash apache.sh
报错:
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
安装软件包【pcre-devel】
[root@localhost httpd-2.4.39]# yum -y install pcre-devel
再次配置
[root@localhost httpd-2.4.39]# bash apache.sh
编译&&安装
[root@localhost httpd-2.4.39]# make && make install