第一种安装过程:
yum install httpd -y ##apache软件
yum install httpd-manual ##apache的手册
systemctl start httpd
systemctl enable httpd
firewall-cmd --list-all ##列出火墙信息
firewall-cmd --permanent --add-service=http ##永久允许http
firewall-cmd --reload ##火墙从新加载策略
/var/www/html ##apache的/目录,默认发布目录
/var/www/html/index.html ##apache的默认发布文件
vim /var/www/html/index.html ##写默认发布文件内容
<h1> hello world </h1>
rpm -qa |grep httpd 查看rpm包
第二种安装方法:
1、下载软件:apr、apr-util、pcre、httpd(从Apache官方网站下载)
2、安装apr、apr-util、pcre三个依赖包:(以下方法为编译安装)
配置环境:
#yum -y install autoconf // 安装autoconf
#yum -y install libtool // 安装libtool
#yum -y install openssl openssl-devel // 安装openssl
tar zxf apr-1.5.2.tar.gz
./configure --prefix=/usr/local/apr
make && make install
tar zxf apr-util-1.5.4.tar.gz
./configure --prefix=/usr/local/web/apr-util --with-apr=/user/local/apr
make && make install
下载不成功:可能缺expat的开发库 yum install expat-devel
tar zxf pcre-8.38.tar.gz
./configure --prefix=/user/local/pcre
make