CentOS7使用httpd apache 和firewalld打开关闭防火墙与端口

本文介绍了在CentOS7中如何使用systemctl管理和启动httpd服务,以及如何使用firewalld打开和关闭防火墙及端口。通过systemctl进行服务的启动、停止、重启以及设置开机启动或关闭。同时,详细阐述了firewalld的基本操作,包括查看状态、启动和停止服务,并展示了如何通过firewalld-cmd添加、删除和查看端口规则。
摘要由CSDN通过智能技术生成

CentOS7使用httpd apache 和firewalld打开关闭防火墙与端口
CentOS7使用systemctl工具操作命令

第一、启动、终止、重启

systemctl start httpd.service #启动

systemctl stop httpd.service #停止

systemctl restart httpd.service #重启

第二、设置开机启动/关闭

systemctl enable httpd.service #开机启动

systemctl disable httpd.service #开机不启动

第三、检查httpd状态

systemctl status httpd.service

firewalld打开关闭防火墙与端口

1、firewalld的基本使用
启动: systemctl start firewalld
查看状态: systemctl status firewalld
停止: systemctl disable firewalld
禁用: systemctl stop firewalld

2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。
启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值