centos7啟動httpd命令有兩個可以用
service httpd start
systemctl start httpd.service
如果出現如下報錯
Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.
應該是端口被占用,查看端口
netstat -antlp | grep 80
是nginx占用了端口
systemctl stop nginx.service
停用nginx即可
如果想開機關閉nginx則輸入命令 systemctl disable nginx