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打开关闭防火墙与端口的更多相关文章

  1. CentOS7使用firewalld打开关闭防火墙与端口(转载)

    1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disabl ...

  2. 关于学习CentOS7使用firewalld打开关闭防火墙和端口

    1.firewalld简介 firewalld是centos7的一大特点,主要有两个优点:一是支持动态更新,不需要重启服务:二就是加入了防火墙的“zone”概念. firewalld有图形界面和工具界 ...

  3. CentOS7使用firewalld打开关闭防火墙与端口(转)

    CentOS7使用firewalld打开关闭防火墙与端口       1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop ...

  4. CentOS7使用firewalld打开关闭防火墙与端口

    1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld  停止: systemctl disab ...

  5. CentOS7 使用firewalld打开关闭防火墙与端口

    1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status f ...

  6. CentOS7 使用firewalld打开关闭防火墙以及端口

    1.firewalld的基本使用 启动 systemctl start firewalld 关闭 systemctl stop firewalld 查看状态 systemctl status fire ...

  7. CentOS7使用firewalld打开关闭防火墙与端口[转]

    转自:http://www.cnblogs.com/moxiaoan/p/5683743.html1.firewalld的基本使用启动: systemctl start firewalld查看状态: ...

  8. 莫小安 CentOS7使用firewalld打开关闭防火墙与端口

    1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld  停止: systemctl disab ...

  9. 转 CentOS7使用firewalld打开关闭防火墙与端口

    http://blog.csdn.net/huxu981598436/article/details/54864260 开启端口命令 输入firewall-cmd --query-port=6379/ ...

随机推荐

  1. Python大神成长之路: 第三次学习记录 集合 函数 装饰 re

    学习记录day03   字符串可以直接切片,But字符串不可修改 字符串修改:生成了一个新的字符串 LIst修改,在原基础上修改(原内存上)     集合是一个无序的,不重复的数据组合,它的主要作用如 ...

  2. Python大神成长之路: 第二次学习记录

    数据类型          数据操作 bytes 类型 "".encode() 编码-->二进制 "".decode() 解码 判断字符串里的字符是否全为 ...

  3. 【Hbase学习之四】Hbase表设计案例

    环境 虚拟机:VMware 10 Linux版本:CentOS-6.5-x86_64 客户端:Xshell4 FTP:Xftp4 jdk8 hadoop-2.6.5 hbase-0.98.12.1-h ...

  4. 【Hive学习之五】Hive 参数&动态分区&分桶

    环境 虚拟机:VMware 10 Linux版本:CentOS-6.5-x86_64 客户端:Xshell4 FTP:Xftp4 jdk8 hadoop-3.1.1 apache-hive-3.1.1 ...

  5. Spring源码阅读(四)

    我们知道,在spring bean生命周期中,我们可以在不同阶段执行处理器或者方法,比如init-method,destroy方法,BeanPostProcessor接口等.那么这些处理器或方法的执行 ...

  6. 安卓apk的编译与反编译

    原文:https://blog.csdn.net/baidu_33870664/article/details/80186945 android基于java的,而java反编译工具很强悍,所以对正常a ...

  7. C语言学习感受

    C语言,是我学习的第一种计算机语言,是他作为我编写程序的开始,在学习的时候,先学习了最基础的知识,在语言的理论学习语法上,我逐渐的了解了C语言并且对他有了基础的认识与理解,随着学习内容的不断深入,我逐 ...

  8. Thread(26)

    1.进程:进程指正在运行的程序.确切的来说,当一个程序进入内存运行,即变成一个进程,进程是处于运行过程中的程序,并且具有一定独立功能. 2.线程:线程是进程中的一个执行单元,负责当前进程中程序的执行, ...

  9. 转:C#串口编程

    本文用来简单介绍一下C#串口编程的知识,主要以实例为内容. 凡是串口设备和计算机交互的时候都用到串口,在C#中我们如何来操作串口呢? 大话串口工作原理 实际串口是用来和外部设备进行交换数据的,我抽象出 ...

  10. SQL SERVER镜像配置(包含见证服务器)

    镜像简介   重要说明:保持数据库镜像运行.如果您关闭数据库镜像,则必须执行完全备份并还原数据库以重建数据库镜像.   一. 简介 SQL SERVER 2005镜像基于日志同步,可良好实现故障转移. ...