Apache apr_sockaddr_info_get()失败错误[关闭]


10

我的apache服务给了我错误,我只是在我的AWS云实例上使用了一个snapshop,一切似乎都很好,并且我的网站一直在工作,直到重新启动apache为止,现在它给了我以下错误:

ubuntu@ip-10-0-0-217:/var/www$ sudo service apache2 restart
sudo: unable to resolve host ip-10-0-0-217
 * Restarting web server apache2 
apache2: apr_sockaddr_info_get() failed for ip-10-0-0-217
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
 ... waiting apache2: apr_sockaddr_info_get() failed for ip-10-0-0-217
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

在用户端This website is temporarily unavailable, please try again later.,他们尝试访问该网站时会遇到麻烦。

我怎样才能解决这个问题?


2
向我们展示Apache的配置。
Braiam 2014年

Answers:


12

我也有这个问题,无法在Ubuntu 14.04上很好地安装Apache 2.4。

我最终发现我在/etc/hosts服务器中设置的服务器名称/etc/hostnamethissrv2的文件中输入了错误的名称时最终解决了

i.e. hosts was (after I changed it) ...
127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
127.0.1.1       thissvr1
91.189.88.140   ports.ubuntu.com
91.189.95.83    ppa.launchpad.net
54.224.40.137   repo.linaro.org

一旦我将条目更正为下面的条目(现在与一致/etc/hostname),错误就会消失

127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
127.0.1.1       thissvr2
91.189.88.140   ports.ubuntu.com
91.189.95.83    ppa.launchpad.net
54.224.40.137   repo.linaro.org

希望这会导致其他人修复这种类型的错误。


7

仅在安装了apache并且尚未完成设置时,会发生这种情况。无论如何,快速搜索[1]的第一个结果提供以下信息:

要解决该问题,您需要编辑httpd.conf文件。打开终端并输入,

sudo nano /etc/apache2/httpd.conf

默认情况下,httpd.conf文件为空。现在,只需将以下行添加到文件中。

ServerName localhost

保存文件并从退出。最后重启服务器。

sudo /etc/init.d/apache2 restart

[1] https://www.google.es/search?client=ubuntu&channel=fs&q=apache+fully+name&ie=utf-8&oe=utf-8&gfe_rd=cr&ei=hYmVU-ulHI7D8gedu4EY


我尝试了一个,但没有解决问题。
user291679 2014年

仍然显示相同的错误?在日志中显示更多详细信息吗?
XiR_
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.