1.安装 apr
************************************************************
tar -zxvf apr-1.7.0.tar.gz
cd apr-1.7.0
vim configure
将 RM='$RM' 改成 RM='$RM -f'./configure --prefix=/usr/apr #指定安装的位置
make && make install
************************************************************2.安装 apr-util
tar -zxvf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1./configure --prefix=/usr/local/apr-util --with-apr=/usr/apr
make && make install
************************************************************3.安装pcre
tar -zxvf pcre-8.44.tar.gz
cd pcre-8.44./configure --prefix=/usr/local/pcre
make && make install
************************************************************4.安装openssl
tar -zxvf openssl-1.1.1i.tar.gz
cd openssl-1.1.1i
./config
make && make install
************************************************************5.httpd
tar -zxvf httpd-2.4.46.tar.gz
cp -rf /root/yoyo/apr-1.7.0/root/yoyo/httpd-2.4.46/srclib/apr
cp -rf /root/yoyo/apr-util-1.6.1/root/yoyo/httpd-2.4.46/srclib/apr-util
cd /root/yoyo/httpd-2.4.46/./configure --prefix=/usr/local/httpd --with-included-apr --sysconfdir=/etc/httpd/--enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre=/usr/local/pcre --with-apr=/usr/apr --with-apr-util=/usr/local/apr-util
make && make install
************************************************************
启动服务
cd /usr/local/httpd/bin[root@localhost bin]# ./apachectl start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
cd /etc/httpd/
cp httpd.conf httpd.conf.bak
vim httpd.conf
底部命令模式 :set nu
:199
ServerName 127.0.0.1:80
cd /usr/local/httpd/bin/[root@localhost bin]# ./apachectl restart
systemctl stop firewalld.service #关闭防火墙
cd /var/www/html/
vim index.html 改成你想要的内容
在浏览器 输入该服务器的ip地址