最新消息:重新回归WordPress,我要比较认真的开始更新我的博客了。

CentOS6与CentOS7服务管理区别

服务器相关 hanlei 2162浏览

新装了一台linux,系统用的是centos7。以前一直用centos6换到7发现有些命令不能用了,了解了一下发现两个版本区别还是挺大的,但也不会换回6了,只能再学习一下centos7了。

CentOS 7 的服务管理

首先是CentOS 7的service 没有了,换成了systemctl命令。个人还是喜欢用service命令管理。systemctl实际上将service 和 chkconfig 两个命令组合到了一起。

下面列出一些常用指令新旧变化:

使某服务自动启动
    chkconfig –level 3 httpd on

    systemctl enable httpd.service
使某服务不自动启动
    chkconfig –level 3 httpd off

    systemctl disable httpd.service
检查服务状态
    service httpd status

    systemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active)
显示所有已启动的服务
    chkconfig –list

    systemctl list-units –type=service
启动某服务
   service httpd start

   systemctl start httpd.service
停止某服务
   service httpd stop

   systemctl stop httpd.service
重启某服务
   service httpd restart

   systemctl restart httpd.service

 

 

 

转载请注明:HANLEI'BLOG » CentOS6与CentOS7服务管理区别