Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

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.

like image 946
user1220351 Avatar asked Mar 02 '12 22:03

user1220351


People also ask

Could not reliably determine the server's fully httpd?

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.

How do I set the ServerName directive globally in Windows?

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.

What is Apachectl command?

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.


2 Answers

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.

like image 83
riegersn Avatar answered Oct 19 '22 11:10

riegersn


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 
like image 35
Paul Stengel Avatar answered Oct 19 '22 10:10

Paul Stengel