zoukankan      html  css  js  c++  java
  • centos中创建服务和关闭防火墙的基本命令

    centos 6

    ===========================================================================================

    启动和关闭服务

    service  xxx  start /restart/reload/status     # 临时启动、重启、重新加载、查看服务

    /etc/init.d/xxx  start /restart/reload/status     # 临时启动、重启、重新加载、查看服务

    chkconfig  xxx  on/off               # 添加到开机自启中,但是要保证这个服务已经是系统服务

    chkconfig  xxx  list               # 查看这个服务是否已经添加了系统服务

    chkconfig  xxx  --add              #添加系统服务

    chkconfig  xxx  --del               #删除系统服务

    关闭防火墙iptables和selinux

    service  iptables  stop      # 临时关闭

    chkconfig  iptables  off       # 永久关闭,即开机不会启动

    setenforce 0           # 临时关闭

    sed  -i  '7 s/enforcing/disabled/g'  /etc/sysconfig/selinux  # 永久关闭

    ===========================================================================================

    centos 7

    ===========================================================================================

    启动或关闭服务

    systemctl  start/restart/reload/status  xxx.service    # 临时启动、重启、重新加载、查看服务

    systemctl  stop  xxx.service              # 临时关闭服务

    systemctl  enable  xxx.service             # 永久开机,即开机自启

    systemctl  disable  xxx.service             # 永久关闭,【注意disable没有d】

    关闭防火墙firewalld,但是selinux 的相关命令没有改变

    systemctl  stop firewalld                # 临时关闭firewalld

    systemctl  disable firewalld               # 永久关闭firewalld

    注意:centos7中默认的防火墙是firewalld,但是iptables也是存在的,但是需要安装 yum -y install iptables 

    ===========================================================================================

  • 相关阅读:
    ajax 同步模式与异步模式
    Ajax -get 请求
    Ajax -post 请求
    Ajax 遵循HTTP协议
    Ajax 发送请求
    宽高自适应案例
    伸缩导航案例
    伸缩属性的 grow与 shrink
    伸缩布局
    hdu-5858 Hard problem(数学)
  • 原文地址:https://www.cnblogs.com/yunjisuan1024/p/11899579.html
Copyright © 2011-2022 走看看