我的Apache又挂了之apache错误:server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName'

表示物理机装Apache然后有时候关机会忘了关闭Apache然后长此以往会导致各种Apache起不来的缘故,上一次已经出现过一次。今天又出现了 再次记录一下解决的方法。

1.查看错误日志 /var/log/apache2/error.log

就标红框的这个比较诡异([mpm_prefork:notice] [pid 31896] AH00169: caught SIGTERM, shutting down)

百度了一波还是没能判断出来错误的缘故

2.测试一下apache服务器是否正确(命令:apachectl configtest)

爆出如下错误

  AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

经过翻译大概的意思是:无法可靠地确定服务器的完全限定域名,使用127.0.0.1。设置“ServNeNess”指令全局以抑制此消息

大概猜到了。

在配置文件(/etc/apache2/apache2.conf)里随意一个地方添加ServerName localhost:80即解决。

原文地址:https://www.cnblogs.com/nul1/p/9898478.html