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

apachecentoslinux

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.

Best Answer

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.

Related Topic