httpd: apr_sockaddr_info_get() failed on RHEL

When running an Apache web server on Red Hat Enterprise Linux, you may encounter the error AH00557: httpd: apr_sockaddr_info_get() failed or AH00558: httpd: Could not reliably determine the server's fully qualified domain name when trying to start the service. In this tutorial, we will look into the cause of this error and give you a solution for fixing it.

In this tutorial you will learn:

  • How to resolve the httpd: apr_sockaddr_info_get() failed error on RHEL
  • How to resolve the httpd: Could not reliably determine the server's fully qualified domain name error on RHEL
AH00557 and AH00558 error messages on RHEL
AH00557 and AH00558 error messages on RHEL
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Red Hat Enterprise Linux
Software httpd
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

httpd: apr_sockaddr_info_get() failed




We can see this error message occur after we try to start our Apache web server and check the status of it:

$ systemctl status httpd

Note that in newer versions of RHEL, the error you see may be httpd: Could not reliably determine the server's fully qualified domain name. The cause of both errors is the same.

The solution to this error is to set a proper ServerName directive inside of the Apache configuration file. You would ordinarily want to put your fully qualified domain name here, or your local DNS name. If you do not have one, simply setting it to the loopback address will do the trick (execute as root):

# echo 'ServerName 127.0.0.1' >> /etc/httpd/conf/httpd.conf

Then, restart the service for the changes to take effect:

# systemctl restart httpd

Problem solved! When httpd starts back up, you should no longer encounter the error.