CentOS7使用httpd apache 和firewalld打开关闭防火墙与端口
Centos7 使用systemctl 工具操作命令
systemctl 是Centos7的服务管理工具中的主要工具 ,它融合之前service和chkconfig的功能于一体
一、httpd的设置
第一 、 httpd 服务的启动 停止 重启
启动 : systemctl start httpd.service
停止: systemctl stop httpd.service
重启: systemctl restart httpd.service
查看httpd 的状态
systemctl status httpd.service
第二、将httpd 服务设置开机启动
设置为开机启动 : systemctl enable httpd.service
设置开机不启动: systemctl disable httpd.service
二、防火墙设置
firewalld 打开关闭防火墙端口
1.启动: systemctl start firewalld
2.查看状态: systemctl status firewalld
3.停止: systemctl stop firewalld
4.禁用:systemctl disable firewalld
使用systemctl命令
启动一个服务: systemctl start firewalld.service
停止一个服务: systemctl stop firewalld.service
重启一个服务: systemctl restart firewalld.service
查看一个服务的状态 : systemctl status firewalld.service
在开机时启动一个服务: systemctl enable firewalld.service
在开机时禁用一个服务: systemctl disable firewalld.service
查看已经启动的服务列表法: systemctl list-unit-files|grep enabled
查看启动失败的服务: systemctl --failed
配置 firewall-cmd
查看版本:firewall-cmd --version
查看帮助: firewall-cmd --help
查看状态: firewall-cmd --state
查看所有打开的端口: firewall-cmd --zone=public --list-ports
更新防火墙规则: firewall-cmd --reload
查看区域信息: firewall-cmd --get-active-zones
查看指定接口所属区域: firewall-cmd --get-zone-of-interface=eth0
拒绝所有包:firewall-cmd --panic-on
取消拒绝状态: firewall-cmd --panic-off
查看是否拒绝: firewall-cmd --query-panic
开启一个端口
firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent 这个参数是永久生效,如果不设置这个参数,默认重启后就失效)
重新载入,使设置剩下
firewall-cmd --reload
查看
firewall-cmd --zone=public --query-port=80/tcp
删除
firewall-cmd --zone=public --remove-port=80/tcp --permanent
CentOS7使用httpd apache 和firewalld打开关闭防火墙与端口的更多相关文章
- CentOS7使用firewalld打开关闭防火墙与端口(转载)
1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disabl ...
- 关于学习CentOS7使用firewalld打开关闭防火墙和端口
1.firewalld简介 firewalld是centos7的一大特点,主要有两个优点:一是支持动态更新,不需要重启服务:二就是加入了防火墙的“zone”概念. firewalld有图形界面和工具界 ...
- CentOS7使用firewalld打开关闭防火墙与端口(转)
CentOS7使用firewalld打开关闭防火墙与端口 1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop ...
- CentOS7使用firewalld打开关闭防火墙与端口
1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disab ...
- CentOS7 使用firewalld打开关闭防火墙与端口
1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status f ...
- CentOS7 使用firewalld打开关闭防火墙以及端口
1.firewalld的基本使用 启动 systemctl start firewalld 关闭 systemctl stop firewalld 查看状态 systemctl status fire ...
- CentOS7使用firewalld打开关闭防火墙与端口[转]
转自:http://www.cnblogs.com/moxiaoan/p/5683743.html1.firewalld的基本使用启动: systemctl start firewalld查看状态: ...
- 莫小安 CentOS7使用firewalld打开关闭防火墙与端口
1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disab ...
- 转 CentOS7使用firewalld打开关闭防火墙与端口
http://blog.csdn.net/huxu981598436/article/details/54864260 开启端口命令 输入firewall-cmd --query-port=6379/ ...
随机推荐
- oracle 排序 row_number() over(partition by 排序字段)
业务描述:按t.truckId,t.riskCode 分组,每个分组里有分数,取分组中分数最大的那条记录. 如:A1 B1 5 6 A1 B1 5 3 A1 B2 2 5 A1 ...
- Block 实践
OC版 函数中无参无返回值 /* 作为函数参数类型的格式 返回值类型 (^)(形参列表) */ CZPerson.h - (void) test:(void (^)(void))block; CZPe ...
- tr字符串的梗
工作问题总结 声明:应用程序代码为前人所写,仅仅只是维护代码,暂且不论代码风格瑕疵. 结论: 使用tr“包”起来的字符串,可能会被翻译为不同的语言,此时,应用程序在不同语言环境下可能会表现BUG. 1 ...
- python 将文件描述符包装成文件对象
有一个对应于操作系统上一个已打开的I/O 通道(比如文件.管道.套接字等)的整型文件描述符,你想将它包装成一个更高层的Python 文件对象. 一个文件描述符和一个打开的普通文件是不一样的.文件描述符 ...
- 102.自己实现ArrayList
package collection; import java.util.ArrayList; import java.util.List; /** * 自己实现一个ArrayList,帮助理解底层结 ...
- Java的字段初始化规律
package 代码测试; public class InitializeBlockClass { {field=200;} public int field=100; public Initiali ...
- Hybrid App中原生页面 VS H5页面(分享)
本文部分转自 http://www.jianshu.com/p/00ff5664e000 现有3类主流APP,分别为:Web App.Hybrid App(混合模式移动应用,Hybrid有“混合的” ...
- node.js的on、emit、off封装
//绑定事件.触发事件和移除事件 //绑定事件 //on(eventName,cb){} //第一步判断当前事件是否存在,如果不存在则初始化:key:[],然后在将回调函数添加到数据中去 let ev ...
- jsky使用小记
jsky是一款深度WEB应用安全评估工具,能轻松应对各种复杂的WEB应用,全面深入发现里面存在的安全弱点. jsky可以检测出包括SQL注入.跨站脚本.目录泄露.网页木马等在内的所有的WEB应用层漏洞 ...
- MyEclipse如何修改XML文件默认行宽
1.MyEclipse如何修改XML文件默认行宽 Windows--->Preferences--->搜索xml--->XML--->XML Source--->Form ...