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

On the new Apache2 instance that I have running Cacti, I ran into a problem where I get the error message:
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
To fix this, I have to add the following line into the /etc/apache2/httpd.conf file:
ServerName nameofserver
Replace nameofserver with the actual name of the server that you want to have Apache configured under.

7 comments:

Chandresh said...

In case of Ubuntu Hardy Heron, I had to create the file /etc/apache2/conf.d/fqdn with following line as content:
ServerName localhost

Anonymous said...

Thanks, it worked perfectly for me!

Andrea

Mikku said...

Thanks a lot .. It worked for me...

Gulye said...

It worked flawlessly for me too.

Anonymous said...

This helped us. Thank you everyone!

shell# echo $HOSTNAME >> /etc/apache2/conf.d/fqdn

Anonymous said...

Note slight corection to above post:
echo ServerName $HOSTNAME > /etc/apache2/conf.d/fqdn

evo said...

glad that helped!