Centos6.9 编译安装httpd-2.4.29

本文详细介绍如何解决因Apache HTTP Server版本过高导致的依赖问题,并提供了编译安装所需apr及pcre组件的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境准备

hostname:web02 
eth0:192.168.90.7/24 
eth1:172.16.1.7/24

[root@web02 ~]# yum install zlib zlib-devel -y
[root@web02 ~]# mkdir /home/oldboy/tools
[root@web02 ~]# cd /home/oldboy/tools
[root@web02 tools]# wget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.29.tar.gz
[root@web02 tools]# tar -xf httpd-2.4.29.tar.gz 
[root@web02 tools]# cd httpd-2.4.29
[root@web02 httpd-2.4.29]# ./configure --prefix=/application/apache2.4.29 \
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-modules=most \
--enable-so \
--with-mpm=worker \
--enable-rewrite 

......
checking for APR... no
configure: error: APR not found.  Please read the documentation.   
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

# 安装新版本的httpd软件会报以上错误,由于下载的软件版本过高,需要支持的apr系列软件版本也高,这里最好是编译安装apr软件,yum安装的时候版本一般是apr1.3.9,而此apache版本需要至少apr1.4.0及以上。下载以下三种软件包,然后编译安装,最后编译安装httpd就可以了

[root@web02 httpd-2.4.29]# cd ..
[root@web02 tools]# wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz 
[root@web02 tools]# wget http://archive.apache.org/dist/apr/apr-util-1.5.1.tar.gz 
[root@web02 tools]# wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.30/pcre-8.30.tar.gz
[root@web02 tools]# tar -xf apr-1.4.5.tar.gz 
[root@web02 tools]# cd apr-1.4.5
[root@web02 apr-1.4.5]# ./configure --prefix=/usr/local/apr
[root@web02 apr-1.4.5]# make && make install
[root@web02 apr-1.4.5]# cd ..
[root@web02 tools]# tar -xf apr-util-1.5.1.tar.gz 
[root@web02 tools]# cd apr-util-1.5.1
[root@web02 apr-util-1.5.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config 
[root@web02 apr-util-1.5.1]# make && make install
[root@web02 tools]# cd pcre-8.30
[root@web02 pcre-8.30]# ./configure --prefix=/usr/local/pcre
[root@web02 pcre-8.30]# make && make install

# 继续编译安装httpd软件
[root@web02 tools]# cd httpd-2.4.29
[root@web02 httpd-2.4.29]# ./configure --prefix=/application/apache2.4.29 \
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-modules=most \
--enable-so \
--with-mpm=worker \
--enable-rewrite \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-pcre=/usr/local/pcre
[root@web02 httpd-2.4.29]# make && make install
[root@web02 httpd-2.4.29]# ln -s /application/apache2.4.29/ /application/apache
[root@web02 httpd-2.4.29]# ll /application/apache
lrwxrwxrwx 1 root root 26 Mar 26 13:30 /application/apache -> /application/apache2.4.29/
[root@web02 tools]# ls /application/apache
bin  build  cgi-bin  conf  error  htdocs  icons  include  logs  man  manual  modules

转载至https://blog.youkuaiyun.com/mr_rsq/article/details/79697088


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值