Centos6.9 编译安装httpd-2.4.29

环境准备

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.csdn.net/mr_rsq/article/details/79697088


猜你喜欢

转载自blog.csdn.net/vic_qxz/article/details/80537640