Solution : httpd: apr_sockaddr_info_get() failed for ip-xxx-xx-x-xxx

After a fresh install of Apache on a Centos machine I was getting this error.

Starting httpd: httpd: apr_sockaddr_info_get() failed for ip-xxx-xx-x-xxx
httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

Nothing critical, the IP was still accesing the PHP pages. But we can remove the above warning messages by:

  1. Open the httpd.conf file
sudo nano /etc/httpd/conf/httpd.conf

2. Search the string : ServerName ( Ctrl + W)

3. Add/update the ServerName to

ServerName 127.0.0.1:80

4. Restart apache.

sudo service httpd restart

And it shows ,

Stopping httpd: [ OK ]
Starting httpd: [ OK ]

Yeah, learnt something new 🙂