1. 程式人生 > >Centos 6.9 Install httpd-2.4.26

Centos 6.9 Install httpd-2.4.26

依賴包
yum install gcc gcc-c++ autoconf automake libtool libtool make cmake zlib zlib-devel openssl openssl-devel pcre-devel  numactl libaio perl-Time-HiRes per-devel libxml2 libxml2-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel -y

解除安裝預設httpd
rpm -qa|grep httpd
yum remove http-*****

下載httpd
wget http://mirrors.hust.edu.cn/apache/httpd/httpd-2.4.26.tar.gz
wget http://mirrors.hust.edu.cn/apache//apr/apr-1.5.2.tar.gz
wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.4.tar.gz

解壓
tar -zxvf httpd-2.4.26.tar.gz
tar -zxvf apr-1.5.2.tar.gz
tar -zxvf apr-util-1.5.4.tar.gz

mv apr-1.5.2 httpd-2.4.26/srclib/apr
mv apr-util-1.5.4 httpd-2.4.26/srclib/apr-util

cd httpd-2.4.26
./configure --with-included-apr --enable-nonportable-atomics=yes --with-z
make
make install


cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd
# chkconfig: 2345 10 90
# description: Activates/Deactivates Apache 2.4.26

開機啟動
chkconfig --add httpd
chkconfig httpd on