欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

Apache启动时报Could not reliably determine the server's fully qualified domain name

发布时间:2023/11/27 57 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Apache启动时报Could not reliably determine the server's fully qualified domain name 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

在系统启动时apache,没有启动起来,查看“事件查看器”发现报一些错误:

The Apache service named  reported the following error:
>>> httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.0.200 for ServerName  

回头,查看apache日志logs/error.log,发现报的是类似的错误。

都是说Could not reliably determine the server's fully qualified domain name。

我先分析了下,似乎是apache启动时可能会查询DNS来验证ServerName的配置。可是我用的是私有IP的,这怎么配置?

抱着疑问的态度,我又查看 httpd.conf 文件,查找关于ServerName配置的片段,我忽然发现,人家已经在注释中把这个问题说的很详细,可是我在开始的配置中却忽视了他。

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerNamewww.web8cn.com:80

所以嘛,你如果是在本地电脑上开发,可以这样写:

ServerName 127.0.0.1:80

 

重新启动apache查看日志无再报错,问题解决了。

 

这是我又回过头好好想想我安装apache时的步骤。

我发现开始安装的时候,如果它会让你填写类似 域名和主机名的信息。

如果你是正式部署可以写正确的域名,如果只是开发用的是私有IP的话可以写自己的私有IP。

转载于:https://www.cnblogs.com/58top/archive/2012/05/03/2479987.html

总结

以上是生活随笔为你收集整理的Apache启动时报Could not reliably determine the server's fully qualified domain name的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。