[Apache][Error] httpd: apr_sockaddr_info_get() failed for

Tadashi Shigeoka ·  Thu, February 2, 2012

After installing Apache, the following error occurred when starting or running configtest:

httpd: apr_sockaddr_info_get() failed for server_name httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

■ Solution

● Set the hostname correctly in /etc/hosts

(Example) When hostname is www.codenote.net

127.0.0.1               www.codenote.net localhost.localdomain 

● Change configuration in /etc/sysconfig/network

HOSTNAME=www.codenote.net

● Execute service network restart

If you forgot to restart the network after changing /etc/sysconfig/network configuration.  

● Change ServerName configuration in /etc/httpd/conf/httpd.conf

# 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.
#
#ServerName www.example.com:80
ServerName www.codenote.net:80

That’s all from the Gemba regarding Apache hostname configuration.  

【References】

Apache で apr_sockaddr_info_get() failed for が発生する - foldrrの日記

Apache の httpd: apr_sockaddr_info_get() failed for エラー