Fix Apache Error: Could not reliably determine the server’s fully qualified domain name

Apache HTTP ServerI purchased a VPS with DigitalOcean to test out some PHP scripts and to increase my overall Apache and Linux skills.

However, upon restarting my Apache webserver running Ubuntu 64-bit, I was greeted with this error message:

[email protected]:~# sudo /etc/init.d/apache2 restart
* Restarting web server apache2

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

Fixing this problem is, however, quite easy. Apache wants you to define a ServerName. So let’s add it by first opening terminal and editing the httpd.conf file:

sudo nano /etc/apache2/apache2.conf

Go to the very bottom of that file and add this line:

ServerName localhost

The error code AH00558 should now be gone. Try restarting the Apache daemon to see if the error message is indeed no longer displayed:

sudo /etc/init.d/apache2 restart

The output will look like this:

[email protected]:~# sudo /etc/init.d/apache2 restart
* Restarting web server apache2 [ OK ]

 

Author Bio

Thank you for your interest in my blog! On this miniblog, I write mostly short (technical) blog posts that might interest other people. Read more about me or feel free to contact me.

 

7 thoughts on “Fix Apache Error: Could not reliably determine the server’s fully qualified domain name

  1. It solved my issue. I had the same issue. But the problem is that “Problem has gone”.
    But https: is not looking green. It become green when we are loading the content of website.
    But Once website is loaded https green color go away.
    Kindly help me to fix it.

    1. Hi
      This could mean some resources are not loaded over HTTPS, but over an unsecured HTTP connection.
      Or, you could be using the deprecated SHA-1 algorithm for your certificate. Read here why you shouldn’t be using SHA-1 any longer.

Leave a Reply

Your e-mail address will not be published. Required fields are marked *