CentOS7系统操作httpd服务

来源:互联网 发布:cl.r27.lol index.php 编辑:程序博客网 时间:2024/06/07 07:09

操作部署某个环境的时候使用的是CentOS7版本,在需要启动httpd服务的时候惯性的使用service httpd start命令,提示有"/bin/systemctl start  httpd.service"问题。

当然,为了兼容性,我们原来习惯使用的service命令在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