編譯 Apache 2.4.x, 需先安裝 libtool 套件, APR, APR-util, PCRE
# APR
URL=`wget -qO- http://apr.apache.org/download.cgi | awk -F\" '/apr.*bz2/ {print $2}' | head -1`
wget $URL
tar jxf apr-*
cd apr-*
./configure
make
make install
cd ..
# APR Util
URL=`wget -qO- http://apr.apache.org/download.cgi | awk -F\" '/apr-util.*bz2/ {print $2}' | head -1`
wget $URL
tar jxf apr-util-*
cd apr-util-*
./configure --with-apr=/usr/local/apr
make
make install
cd ..
# PCRE
URL=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.bz2
wget $URL
tar jxf pcre-*
cd pcre-*
./configure
make
make install
cd ..
# Apache
URL=`wget -qO- http://httpd.apache.org/download.cgi | awk -F\" '/httpd.*bz2/ {print $2}' | head -1`
wget $URL
tar jxf httpd-*
cd httpd-*
./configure --prefix=/usr/local/apache --sysconfdir=/usr/local/apache/conf \
--enable-ssl --enable-rewrite --enable-proxy --enable-expires --enable-headers \
--enable-reqtimeout --enable-deflate --with-apr=/usr/local/apr
make
make install
註: Apache 2.4.x 要搭配 PHP 5.3.x 以上的版本, 已不支援 PHP 5.2.x (會有錯誤產生)
Leave a comment