• 28th April 2010 - By iKode

    If you have Apache2 installed on a virtual server , you may have come across this.  You change your config and go to restart apache…

    # 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
    …done.

    But you get this status message about domains… and servernames… and 127.0.1.1.  But things seem to be ok when apache restarts, websites are working as they should.

    Well in order to get rid of that error you have to add this line of code

    ServerName localhost

    to

    /etc/apache2/httpd.conf

    Once you do this and restart apache you should find that there is no longer any status messages.  You should now get…

    # sudo /etc/init.d/apache2 restart

    * Restarting web server apache2

    … waiting    …done.
    Now before you restart your server after any config changes you will want to test your configured file first with the following command, and if everything is good this is what you should see…

    #apache2ctl configtest
    Syntax OK

    if everything looks good , go ahead and restart , all should be well!

    Read Also:

    1. Monitor your server using your iPhone and iStat Server
    2. .htaccess apache rewrite rules
  • 3 Responses to “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName”

    • Brian Reich on April 29, 2010

      Unless I’m missing something with your virtual server configuration, could the fact that your loopback address was configured to 127.0.1.1 instead of 127.0.0.1 be problematic?
      Brian Reich´s last blog ..Use a Different Password for Insecure Websites My ComLuv Profile

      Like or Dislike: Thumb up 0 Thumb down 0

    • Daniel Tisza-Nitsch on April 29, 2010

      Actually, it’s got nothing to do with a Virtual Server.

      The problem lies with the fact that *nix servers expect a correct “domain name” or hostname.

      On a fresh install of *nix systems, often the default name will be set to localhost or 127.0.0.1. This is not a “correct” NAME (localhost is not a “real address” to a server, but something know as a loop-back address). Since many people set up their *nix environments for testing or development purposes, there is usually no need to ever change that.

      The problem lies with the fact that Apache is expecting the server to be set up as if it was a fully / properly configured hosting server, and is just being picky about getting the information on the server set up correctly so that there are no loopholes or errors later on. For that reason, force setting the “ServerName” to something in the httpd.conf (or apache2.conf if you are using ubuntu) will bypass the step of checking the server for the domain name, since you manually set it up in the config file!

      Like or Dislike: Thumb up 0 Thumb down 0

    • to domain name on May 3, 2010

      hi guys…

      hi guysI would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well and i have start my own blog now, , thanks for your effort…

      Like or Dislike: Thumb up 0 Thumb down 0

    Leave a Reply

    Spam protection by WP Captcha-Free


PHVsPjxsaT48c3Ryb25nPndvb19hZF9mb290ZXI8L3N0cm9uZz4gLSBmYWxzZTwvbGk+PGxpPjxzdHJvbmc+d29vX2FkX2Zvb3Rlcl9hZHNlbnNlPC9zdHJvbmc+IC0gPC9saT48bGk+PHN0cm9uZz53b29fYWRfZm9vdGVyX2ltYWdlPC9zdHJvbmc+IC0gaHR0cDovL3d3dy53b290aGVtZXMuY29tL2Fkcy93b290aGVtZXMtNDY4eDYwLTIuZ2lmPC9saT48bGk+PHN0cm9uZz53b29fYWRfZm9vdGVyX3VybDwvc3Ryb25nPiAtIGh0dHA6Ly93d3cud29vdGhlbWVzLmNvbTwvbGk+PGxpPjxzdHJvbmc+d29vX2FsdF9zdHlsZXNoZWV0PC9zdHJvbmc+IC0gZGVmYXVsdC5jc3M8L2xpPjxsaT48c3Ryb25nPndvb19hdXRvX2ltZzwvc3Ryb25nPiAtIGZhbHNlPC9saT48bGk+PHN0cm9uZz53b29fY2F0X2NvbG9yXzE8L3N0cm9uZz4gLSA8L2xpPjxsaT48c3Ryb25nPndvb19jYXRfY29sb3JfMTE8L3N0cm9uZz4gLSA0RTgyMDA8L2xpPjxsaT48c3Ryb25nPndvb19jYXRfY29sb3JfMTI8L3N0cm9uZz4gLSAwMEZGRkI8L2xpPjxsaT48c3Ryb25nPndvb19jYXRfY29sb3JfMTM8L3N0cm9uZz4gLSAwMDZCMDU8L2xpPjxsaT48c3Ryb25nPndvb19jYXRfY29sb3JfMjE8L3N0cm9uZz4gLSA8L2xpPjxsaT48c3Ryb25nPndvb19jYXRfY29sb3JfMjI8L3N0cm9uZz4gLSA0MDAwNUM8L2xpPjxsaT48c3Ryb25nPndvb19jYXRfY29sb3JfMjQ8L3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