I tried to restart my Apache server on CentOS 5.0 and got this message:
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Here is the /etc/hosts
file:
127.0.0.1 server4-245 server4-245.com localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6
Here is the /etc/sysconfig/network
file:
NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=server4-245
I also have this in the Apache httpd.conf file:
ServerName localhost
However, I still get the first error message when I restart Apache.
An Apache AH00558: Could not reliably determine the server's fully qualified domain name message is generated when Apache is not configured with a global ServerName directive. The message is mainly for informational purposes, and an AH00558 error will not prevent Apache from running correctly.
The fix for this configuration error is simple: all you have to do is edit your “/etc/apache2/apache2. conf” file, adding a global ServerName directive. Note that this global directive is required to eliminate the error message even if you already have a virtual server configured with its own ServerName directive.
apachectl is a front end to the Apache HyperText Transfer Protocol (HTTP) server. It is designed to help the administrator control the functioning of the Apache httpd daemon.
If you don't have httpd.conf
in folder /etc/apache2
, you should have apache2.conf - simply add:
ServerName localhost
Then restart the apache2
service.
Your hosts file does not include a valid FQDN, nor is localhost
an FQDN. An FQDN must include a hostname part, as well as a domain name part. For example, the following is a valid FQDN:
host.server4-245.com
Choose an FQDN and include it both in your /etc/hosts
file on both the IPv4 and IPv6 addresses you are using (in your case, localhost
or 127.0.0.1
), and change your ServerName
in your httpd configuration to match.
/etc/hosts:
127.0.0.1 localhost.localdomain localhost host.server4-245.com ::1 localhost.localdomain localhost host.server4-245.com
httpd.conf:
ServerName host.server4-245.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With