启动Apache时经常会遇到如下问题:
报错内容:httpd[4018]: AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using xxx.xxx.xxx.xxx. Set the ‘ServerName’ directive globally to suppress this message
httpd[4018]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
报错原因:Apache中的配置文件出错,没有进行指定IP和端口的设置
解决方法:
1、修改httpd配置文件
vim /etc/httpd/conf/httpd.conf
修改 ServerName www.example.com:80 为 ServerName IP地址:80
注:如果80端口在你本机已经被占用,则重新输入一个端口
2、然后重启httpd服务
systemctl restart httpd
systemctl status httpd
服务已起!