apache的安装和php一样:
防火墙开启80端口,
firewall-cmd --zone=public --add-port=80/tcp --permanent
重启防火墙
systemctl restart firewalld.service
wget http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.20.tar.gz
tar -zxvf httpd-2.4.20.tar.gz
cd httpd-2.4.20.tar.gz
ll
./configure --prefix=/usr/local/apache2
cd ~
wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
ll
tar -zxvf apr-1.4.5.tar.gz
tar -zxvf apr-util-1.3.12.tar.gz
ll
mv apr-1.4.5 apr
mv apr-util-1.3.12 apr-util
ll
mv apr apr-util httpd-2.4.20/srclib/
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
mv download pcre.tar.bz2
tar -jxvf pcre.tar.bz2
cd pcre-8.37/
./configure --prefix=/usr/local/pcre-8.37
make
make install
cd ~
cd httpd-2.4.20
./configure --prefix=/usr/local/apache -with-pcre=/usr/local/pcre-8.37/bin/pcre-config -with-included-apr
make
make install
cd /usr/local/apache/bin/
./apachectl -k start
firewall-cmd --zone=public --add-port=80/tcp --permanent
systemctl restart firewalld.service