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. 【转】SQL Server 运行状况监控SQL语句

    SQL Server 运行状况监控SQL语句   Microsoft SQL Server 2005 提供了一些工具来监控数据库.方法之一是动态管理视图.动态管理视图 (DMV) 和动态管理函数 (D ...

  2. Permutation Bo (数学证明)

    当在两端时:共有n * (n - 1)种组合,满足条件的有,计算可得, counter = n * (n - 1) / 2. 其他位置时:共有n * (n - 1) * (n - 2) 种组合,满足条 ...

  3. 在lua中从一个字符串中移除空间源码

    /* trim.c - based on http://lua-users.org/lists/lua-l/2009-12/msg00951.html from Sean Conner */ #inc ...

  4. 【2017-2-24】C#循环嵌套,跳转语句,迭代穷举,异常语句,while循环

    循环嵌套 在一个循环体语句中包含另一个循环语句: 99乘法表 ; i <= ; i++) { ; j <= i; j++) { Console.Write(i+"x"+ ...

  5. iview的table中点击Icon弹Poptip,render函数的写法

    render: (h, params) => { return h('div', [ h('div', [ h('Poptip', { props: { confirm: true, trans ...

  6. 【Alpha版本】冲刺阶段——Day1

    [Alpha版本]冲刺阶段--Day1 阅读目录 Alpha 阶段成员分工及任务量 团队成员贡献值的计算规则 明日任务 今日贡献量 站立式会议 TODOlist [Alpha 阶段成员分工及任务量] ...

  7. QT -- plan

     QT  --  跨平台的 C++ 图形用户界面  应用程序框架 GUI介绍框架项目文件  .pro第一个QT (hello QT)父窗口 和 子窗口的区别(控件,部件,构件)信号 和 槽(信号的处理 ...

  8. vue之component

    因为组件是可复用的 Vue 实例,所以它们与 new Vue 接收相同的选项,例如 data.computed.watch.methods 以及生命周期钩子等.仅有的例外是像 el 这样根实例特有的选 ...

  9. centos 安装MySQL全过程

    1.到chinaunix下载mysql 下载地址: http://download.chinaunix.net/download/0008000/7159.shtml 2.上传到CentOS服务器 本 ...

  10. SQL Server 2008 R2 常用系统函数学习

    /******************************************* * 聚合函数 *******************************************/ SEL ...