基本格式:systemctl
+ 关键指令
+ httpd
基础操作 | 关键指令 |
---|---|
启动 | start |
停止 | stop |
重启 | restart |
查看状态 | status |
开启开机自启动 | enable |
关闭开机自启动 | disable |
表格的列出是为了复盘时可以更加方便的查阅,毕竟下面的命令不变的是格式。
一.安装服务
yum install httpd -y
二.查看所有服务列表
systemctl list-unit-files
三 . 启动服务
systemctl start httpd
四.停止服务
systemctl stop httpd
五.重启服务
systemctl restart httpd
六.查看服务状态
systemctl status httpd
七.把服务设置为开机自启动
systemctl enable httpd
八.取消服务的开机自启动
systemctl disable httpd
九.关闭防火墙:
systemctl stop firewalld
systemctl disable firewalld