12月12, 2017

Apache httpd 编译安装

System & Software Version.

Name Version Date
System Centos7.x 2017-11
Httpd 2.4.x 2017-11
apr 1.6.x 2017-11
apr-util 1.6.x 2017-11

Install dependecy

sudo yum install -y gcc gcc-c++ bzip2 bzip2-devel lbzip2 libzip libzip-devel unzip pcre-devel zlib-devel openssl-devel lua-devel gd-devel libxml2-devel libxslt-devel GeoIP-devel libxslt-devel readline-devel sqlite-devel krb5-devel libcurl-devel libwebp-devel libpng-devel libjpeg-turbo-devel libXpm-devel freetype-devel gettext-devel libnghttp2-devel apr-devel systemtap-sdt-devel

APR and APR-Util

Reference: https://httpd.apache.org/docs/2.4/install.html#requirements

tar xjf apr-1.6.3.tar.bz2 -C /path/httpd-2.4.x/srclib/
tar xjf apr-util-1.6.1.tar.bz2 -C /path/httpd-2.4.x/srclib/

mv /path/httpd-2.4.x/srclib/apr-1.6.3 /path/httpd-2.4.x/srclib/apr
mv /path/httpd-2.4.x/srclib/apr-util-1.6.1 /path/httpd-2.4.x/srclib/apr-util

Configure & install

# 编译选项
./configure \
--prefix=/opt/soft/apache2 \
--enable-pie \
--enable-allowmethods \
--enable-isapi \
--enable-file-cache  \
--enable-cache  \
--enable-request \
--enable-include \
--enable-http \
--enable-mime-magic \
--enable-cern-meta  \
--enable-expires \
--enable-remoteip \
--enable-proxy \
--enable-proxy-connect \
--enable-proxy-ftp  \
--enable-proxy-http \
--enable-proxy-fcgi \
--enable-proxy-scgi \
--enable-proxy-fdpass  \
--enable-proxy-wstunnel \
--enable-proxy-ajp \
--enable-proxy-balancer \
--enable-proxy-express \
--enable-proxy-hcheck \
--enable-session \
--enable-ssl  \
--enable-http2  \
--enable-proxy-http2  \
--enable-lbmethod-byrequests \
--enable-dav \
--with-included-apr \
--with-crypto \
--with-pcre \
--with-z \
--with-libxml2 \
--with-ssl 

# 编译
make -j4

# 安装
make install

本文链接:https://fandenggui.com/post/apache-httpd-compile-install.html

-- EOF --

Comments