Apache服务
- Apache的作用
- Apache的安装
- Apache的启用
- Apache的基本信息
- Apache的基本配置
- Apache的访问控制
实验环境:设定ip,配置yum源,yum仓库
1.Apache的作用
在web被访问时通常使用http://的方式
http:// ##表示超文本传输协议
http:// 超文本传输协议提供的软件:
Apache (同步的阻塞模式,稳定性高)
nginx (异步的非阻塞模式,速度快)
stgw 腾讯的
jfe 京东的
Tengine 淘宝的
从下图可以看出我们访问网址时,会显示http://超文本的方式
2.Apache的安装
yum search apache 寻找apache安装包
dnf install httpd.x86_64 -y 安装apache
安装的具体步骤如下:
3.Apache的启用
systemctl enable --now httpd
或者用:systemctl start http systemctl enable httpd #表示开启服务并设定服务为开机启动
firewall-cmd --list-all #查看火墙信息
firewall-cmd --permanent --add-service=http #在火墙中永久开启http访问
firewall-cmd --permanent --add-service=https #在火墙中永久开启https访问
firewall-cmd --reload #刷新火墙,是设定生效
实验步骤如下:
4.Apache的基本信息
1.服务名称: httpd
2.配置文件: /etc/httpd/conf/httpd.conf #主配置文件
/etc/httpd/conf.d/*.conf #子配置文件
3.默认发布目录: /var/www/html (可以更改的)
默认发布文件: inde