一.查看apache服务器是否运行:
systemctl is-enabled httpd.service
service status httpd
//或者,不同版本Linux不一样
service httpd status
二.启动apache服务器
systemctl start httpd.service #启动apache(仅本次有效,关机后恢复原状态)
systemctl restart httpd.service #重启apache
systemctl enable httpd.service #设置apache(开机自动启动)
service httpd start #启动(仅本次有效,关机后回复原状态)
service httpd restart #重新启动
三.停止apache服务器
systemctl stop httpd.servi