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 - 3. Input and Output

    from:http://interactivepython.org/courselib/static/pythonds/Introduction/InputandOutput.html Input a ...

  2. skynet 报错 skynet 服务缺陷 Lua死循环

    我的报错如下: 看起来是skynet中lua死循环,实际上,可能只是本地配置出了问题,比如,我的数据库连接不上了,因为我把别人的配置更新到我本地了,吗,mysql秘密不对 解决办法就是将配置文件中的, ...

  3. Linux 中常用的命令

    Linux中的常用命令: 终端快捷键: Ctrl + a/Home 切换到命令行开始 Ctrl + e/End 切换到命令行末尾 Ctrl + l 清除屏幕内容,效果等同于clear Ctrl + u ...

  4. redis和mongodb的比较

    >>RedisRedis的优点:支持多种数据结构,如 string(字符串). list(双向链表).dict(hash表).set(集合).zset(排序set).hyperloglog ...

  5. mongodb查看操作记录方法以及用户添加删除权限修改密码

    前一阵跑程序时发现一个问题,同事导出了部分数据,但是在merge回原库时竟然和原库的数据对不上,后来找了半天发现是原库数据少了. 找了很多资料发现很多人认为的操作日志和我想的不太一样...找了半条才发 ...

  6. 区块链公链分片技术(sharding)方案,配思维导图

    区块链公链分片技术(sharding)方案,配思维导图 分片技术(sharding)方案 以太坊分片思路 其基本思想是,将网络中的节点分成不同的碎片,各分片可以并行处理不同交易,这样可以并行处理相互之 ...

  7. 三角形垂点坐标js算法(三点定圆求圆心)

    已知平面三点坐标A(x1, y1).B(x2, y2).C(x3, y3),三点定圆也就是三角形的中垂线交点, //平面三点定位算法 function locate(x1, y1, x2, y2, x ...

  8. CRM rbac 组件的应用

    1 拷贝 rbac 组件到项目中,注册这个app 2 数据库迁移 1 删除rbac下migrations里除了init外的文件 2 修改用户表 class User(models.Model): &q ...

  9. Q_DECL_OVERRIDE

    Q_DECL_OVERRIDE也就是c++的override # define Q_DECL_OVERRIDE override 在重写虚函数时会用到, 作用是防止写错虚函数: void keyPre ...

  10. Java 安全套接字编程以及keytool 使用最佳实践

    概述 利用 Java 的 JSSE(Java Secure Socket Extension)技术,我们可以方便的编写安全套接字程序,关于 JSSE 的介绍,可以参阅 Oracle 网站提供的 JSS ...