Could not reliably determine the server’s fully qualified domain name

By | 2011/02/16

After the initial install of Apache in Ubuntu, you’ll first see this message below:

stmiller@brahms:~$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2                                                
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

If you are not planning on using virtualhosts or other configurations, you can simply create a file specifying the ServerName as below.

1. Create this apache config file:

sudo nano /etc/apache2/conf.d/fqdn

2. Add this to the file:

ServerName localhost

Or make it your desired host or domain name such as:

ServerName example.com

3. Save (in nano: Control + X, then Yes to confirm) and restart Apache:

sudo /etc/init.d/apache2 restart

Done!

5 thoughts on “Could not reliably determine the server’s fully qualified domain name

  1. Daniel

    Thanks man…can you please tell me way using a httpd.conf file with the same content under /etc/apache2/ doesn’t work but your solution does?

    Thanks!

    Reply
  2. altair

    not working mate…getting the same error…!!!

    any other suggestion ??

    Reply
  3. Kuldeep Maurya

    thnx….
    i was trying it to solve from an hour..:)

    Reply
  4. Melsi

    On LMDE 17, (linux mint 17 debian based) you can put “Servername localhost” on /etc/apache2/apache2.conf Sometimes linux is a mess, there is no standard place where .conf files are put, there is no standard name for the same service (you have apache, httpd, apache2, mongo, mongod etc). Debian has a dozen of apache conf files, other distros have less. It would be good to have some standards, in order to save more time.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.