CentOS 6和CentOS 7管理系统服务的区别

简介:

管理系统服务

CentOS 6

CentOS 7

firewalld.service可简写成firewalld

httpd.service可简写成httpd

关闭防火墙

# service iptables stop

# systemctl stop firewalld.service

禁止防火墙开机自启

# chkconfig iptables off

# systemctl disable firewalld.service

查看防火墙是否运行

# service iptables status

# firewall-cmd --state

暂时关闭SELinux

# setenforce 0

禁止SELinux开机自启

(永久关闭SELinux)

# vim /etc/selinux/config  -->   SELINUX=disabled  # reboot

查看SELinux状态

# getenforce

启动httpd服务

# service httpd start

# systemctl start httpd.service

停止httpd服务

# service httpd stop

# systemctl stop httpd.service

重启httpd服务

# service httpd restart

# systemctl restart httpd.service

条件式重启httpd服务

(服务之前已经启动-->重启

服务之前没有启动-->不做任何操作)

# service httpd condrestart

# service httpd try-restart

# systemctl condrestart httpd.service

# systemctl try-restart httpd.service

重载httpd服务

# service httpd reload

# systemctl reload httpd.service

重载或重启httpd服务

(服务支持重载-->重载

服务不支持重载-->重启)

# systemctl reload-or-restart httpd.service

重载或条件式重启httpd服务

(服务支持重载-->重载

服务不支持重载且之前已经启动-->重启

服务不支持重载且之前没有启动-->不做任何操作)

# systemctl reload-or-try-restart httpd.service

查看httpd服务是否运行

# service httpd status

# systemctl is-active httpd.service

# systemctl status httpd.service

设定httpd服务开机自启

# chkconfig httpd on

# systemctl enable httpd.service

禁止httpd服务开机自启

# chkconfig httpd off

# systemctl disable httpd.service

查看httpd服务是否开机自启

# chkconfig --list httpd

# systemctl is-enabled httpd.service

# systemctl status httpd.service

列出所有正在运行的服务

# systemctl list-units --type service

列出所有服务的开机自启状态

# chkconfig --list

# systemctl list-unit-files --type service

禁止设定httpd服务开机自启

(禁用# systemctl enable httpd.service)

# systemctl mask httpd.service

取消禁止设定httpd服务开机自启

(恢复# systemctl enable httpd.service)

# systemctl unmask httpd.service

查看httpd服务的依赖关系

# systemctl list-dependencies httpd.service

结束所有httpd进程

# killall httpd

# systemctl kill httpd




      本文转自Marion0728  51CTO博客,原文链接:http://blog.51cto.com/qiuyue/1950471,如需转载请自行联系原作者







相关文章
|
2月前
|
Java Linux Shell
linux自动部署jar包,注册系统服务(基于Centos7)
linux自动部署jar包,注册系统服务(基于Centos7)
86 0
|
4月前
|
网络协议 Linux Shell
CentOS 7系统下DHCP及中继服务部署
设备 IP地址 主DNS服务器 192.168.100.254 从DNS服务器 192.168.100.1 客户端 192.168.200.2 一、DHCP服务器的部署
116 0
|
4月前
|
Kubernetes Ubuntu 安全
Linux|科普扫盲帖|配置网络软件源---阿里云镜像仓库服务使用(centos,Ubuntu)
Linux|科普扫盲帖|配置网络软件源---阿里云镜像仓库服务使用(centos,Ubuntu)
530 0
|
2月前
|
数据可视化 数据挖掘 Linux
如何在CentOS安装DataEase数据分析服务并实现远程访问管理界面
如何在CentOS安装DataEase数据分析服务并实现远程访问管理界面
218 1
|
3月前
|
安全 应用服务中间件 Linux
百度搜索:蓝易云【CentOS7使用Nginx、Supervisor部署Go/Golang服务教程】
这些是在CentOS 7 x64上使用Nginx和Supervisor部署Go/Golang服务的基本步骤。根据您的需求和具体环境,可能还需要进行其他配置和调整。请确保在进行任何与网络连接和安全相关的操作之前,详细了解您的网络环境和安全需求,并采取适当的安全措施。
61 0
|
4月前
|
Kubernetes Cloud Native Linux
云原生|kubernetes |kubelet服务加入系统守护进程supervisor(centos7系统下演示通过)
云原生|kubernetes |kubelet服务加入系统守护进程supervisor(centos7系统下演示通过)
61 0
|
4月前
|
安全 Linux 网络安全
猿创征文|centos7升级openssh服务(再也不怕漏扫啦)
猿创征文|centos7升级openssh服务(再也不怕漏扫啦)
126 0
|
4月前
|
网络协议 Linux 网络安全
Centos7中如何打开和关闭防火墙??CentOS 7以上默认使用firewall作为防火墙改为iptables
Centos7中如何打开和关闭防火墙??CentOS 7以上默认使用firewall作为防火墙改为iptables
|
4月前
|
消息中间件 Linux 网络安全
CentOS7下安装ActiveMQ并注册服务设置开机启动
CentOS7下安装ActiveMQ并注册服务设置开机启动
83 2
|
4月前
|
中间件 Linux 网络安全
CentOS 7系统下Apache服务部署
对前篇博客(十七)进行一个修正与补充 基于不同的端口号,实现多虚拟主机部署并访问
41 0