安装Apache的步骤
事先准备
yum install gcc
yum install gcc-c++
安装APR
cd /usr/local/src/
wget http://ftp.yz.yamagata-u.ac.jp/pub/network/apache//apr/apr-1.5.2.tar.gz
tar zxvf apr-1.5.2.tar.gz
cd apr-1.5.2/
vim configure
$RM "$cfgfile"
↓更改
$RM -f "$cfgfile"
./configure --prefix=/opt/apr-1.5.2
make
make install
如果在./configure中没有指定–prefix选项,则默认安装到/usr/local/apr目录下。
安装APR-Util
cd /usr/local/src/
wget http://ftp.yz.yamagata-u.ac.jp/pub/network/apache//apr/apr-util-1.5.4.tar.gz
tar zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4/
./configure --with-apr=/opt/apr-1.5.2
make
make install
在进行” ./configure”命令时,需要指定APR的安装目录。
安装PCRE
cd /usr/local/src/
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
tar zxvf pcre-8.40.tar.gz
cd pcre-8.40/
./configure --prefix=/opt/pcre-8.40
make
make install
安装Apache
cd /usr/local/src/
wget http://ftp.tsukuba.wide.ad.jp/software/apache//httpd/httpd-2.4.25.tar.gz
tar zxvf httpd-2.4.25.tar.gz
cd httpd-2.4.25/
./configure --with-apr=/opt/apr-1.5.2 --with-pcre=/opt/pcre-8.40/ --prefix=/opt/apache/2.4.25
make
make install
打开HTTP端口
firewall-cmd --zone=public --add-service=http
firewall-cmd --add-port=8080/tcp