centos7环境下apache2.2.34的编译安装

时间:2023-12-21 12:49:32
.获取apache2..34的源码包
http://archive.apache.org/dist/httpd/httpd-2.2.34.tar.gz
.获取apache的编译参数
apache的编译参数 [root@i-job-backend-web01:~]# cat /usr/local/apache2/build/config.nice
#! /bin/sh
#
# Created by configure "./configure" \
"--prefix=/usr/local/httpd-2.2.26" \
"--enable-isapi" \
"--enable-file-cache" \
"--enable-cache" \
"--enable-mem-cach" \
"--enable-deflate" \
"--enable-expires" \
"--enable-headers" \
"--disable-version" \
"--enable-proxy" \
"--enable-proxy-balancer" \
"--enable-ssl" \
"--enable-static-rotatelogs" \
"--enable-static-htpasswd" \
"--enable-static-htdigest" \
"--enable-static-logresolve" \
"--enable-static-htdbm" \
"--enable-static-ab" \
"--enable-static-checkgid" \
"--enable-static-htcacheclean" \
"--enable-cgi" \
"--enable-vhost-alias" \
"--enable-rewrite" \
"--enable-so" \
"--with-ssl=/usr/local/lab/openssl" \
"--enable-mime-magic" \
"--with-mpm=prefork" \
"$@ # tar –zxf httpd-2.2..tar.gz
# cd httpd-2.2.
# 执行预编译
./configure \
"--prefix=/usr/local/httpd-2.2.34" \
"--enable-isapi" \
"--enable-file-cache" \
"--enable-cache" \
"--enable-mem-cach" \
"--enable-deflate" \
"--enable-expires" \
"--enable-headers" \
"--disable-version" \
"--enable-proxy" \
"--enable-proxy-balancer" \
"--enable-ssl" \
"--enable-static-rotatelogs" \
"--enable-static-htpasswd" \
"--enable-static-htdigest" \
"--enable-static-logresolve" \
"--enable-static-htdbm" \
"--enable-static-ab" \
"--enable-static-checkgid" \
"--enable-static-htcacheclean" \
"--enable-cgi" \
"--enable-vhost-alias" \
"--enable-rewrite" \
"--enable-so" \
"--with-ssl=/usr/local/lab/openssl-1.0.2p" \
"--enable-mime-magic" \
"--with-mpm=prefork" ...... checking for OpenSSL version... checking openssl/opensslv.h usability... yes
checking openssl/opensslv.h presence... yes
checking for openssl/opensslv.h... yes
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
OK
forcing SSL_LIBS to "-lssl -lcrypto "
adding "-lssl" to LIBS
adding "-lcrypto" to LIBS
checking openssl/engine.h usability... yes
checking openssl/engine.h presence... yes
checking for openssl/engine.h... yes
checking for SSLeay_version... no
checking for SSL_CTX_new... yes
checking for ENGINE_init... yes
checking for ENGINE_load_builtin_engines... yes
checking for SSL_set_cert_store... no
configure: error: ... Error, SSL/TLS libraries were missing or unusable
# 因为openssl经常曝出一些大的漏洞,使用最新版本的openssl1..0i
--with-openssl=/usr/local/lab/openssl-1.1.0i # 编译执行
Make && make install 配置文件可以直接将/usr/local/httpd-2.2./conf目录替换到新的编译安装包中
测试