firewall 守护进程:firewlld
基于协议、服务、端口对防火墙进行控制
命令:
firewall-cmd --list-all 查看当前区域的规则
firewall-cmd --set-default-zone=block 更改防火墙当前的区域
临时生效:
firewall-cmd --add-service=http 允许http服务通过防火墙
firewall-cmd --add-port=82/tcp
永久生效:
firewall-cmd --permanent --add-service=http 永久生效 需要重新加载防火墙
firewall-cmd --permanent --add-port=82/tcp
firewall-cmd --reload 重载防火墙
服务
软件实现的功能:服务
服务的守护进程 systemd 服务的管理工具(命令) systemctl
命令:
格式:systemctl 动作 服务名
动作:
start 开启服务
stop 关闭服务
restart 重启服务
status 查看服务的状态
reload 重新加载服务
enable 开机自启
disable 关闭开机自启
is-enable 查看是否开机自启
http服务
1、yum install httpd -y
rpm -q httpd
2、 systemctl start httpd
3、systemctl enable httpd
4、更改配置文件 vim/etc/httpd/conf/httpd.conf
5、建立html文件 存放html文件的目录 /var/www//html/
如果修改配置文件
6、重新加载服务systemctl reload httpd
或者重启服务 systemctl restart httpd
7、允许服务通过防火墙
8、重新加载防火墙
测试
浏览器输入 http://192.168.142.100/aa.html
crul 192.168.142.100:80/aa.html
验证
NTP 时间同步服务器
作为客户端
国家授时中心 NTP服务器 域名:ntp.ntsc.ac.cn
1、下载软件
2、开启服务
3、开机自启
4、配置文件/etc/chrony.conf
server ntp.ntsc.ac.cn iburst
5、重新加载服务
6、chronyc sources查看ntp服务器状态 查看是否正常
作为服务端
autofs
df -hT 查看挂载点目录
软件:autofs
1、yum install autofs -y
2、vim /etc/auto.maseter
内容:
触发挂载点目录 挂载点规则目录
3、vim /etc/auto.misc
内容:
挂载点 挂载规则 挂载源
4、systemctl restart autofs
5、systemctl enable autofs
6、验证 cd 挂载点 是否挂载上