CentOS 7 systemctl
[root@VM_0_13_centos ~]# systemctl start httpd
[root@VM_0_13_centos ~]# systemctl stop httpd
[root@VM_0_13_centos ~]# systemctl restart httpd
[root@VM_0_13_centos ~]# systemctl reload httpd //重新加载(使用新的配置文件):
[root@VM_0_13_centos ~]# systemctl status httpd //显示运行状态
用于设定系统启动时自动运行某服务的指令
apache的启动
开启自动启动
[root@VM_0_13_centos ~]# systemctl enable httpd
关闭自动启动
[root@VM_0_13_centos ~]# systemctl disable httpd
自动启动状态
[root@VM_0_13_centos ~]# systemctl is-enabled httpd