关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

CentOS7系统操作httpd服务 - 开机启动/重启/查看状态

发布时间:2022-09-01 13:42:44
1491984010112764.jpg

八艾云之前一直习惯使用Debian6、CentOS6系统环境,今天早上在操作部署某个环境的时候使用的是CentOS7版本,然后在需要启动httpd服务的时候惯性的使用service httpd start命令,但是提示有"/bin/systemctl start  httpd.service"问题。看来系统变动之后一些操作命令还是有些变化的。

当然,为了兼容性,我们原来习惯使用的service命令在CentOS7中仍然是可以使用的,它会重定向命令到新的systemctl工具命令,这个我们应该有看到的。但是在这篇文章中,既然用到新的CentOS7,那我们就来看看新的systemctl工具操作命令组,算是一个学习记录,以后应该有需要用到。

第一、启动、终止、重启

systemctl start httpd.service #启动

systemctl stop httpd.service #停止

systemctl restart httpd.service #重启

第二、设置开机启动/关闭

systemctl enable httpd.service #开机启动

systemctl disable httpd.service #开机不启动

第三、检查httpd状态

systemctl status httpd.service



/template/Home/8a/PC/Static