I Don’t know how I got this error in my web server, but after researching and trying things I got the solution.

It is just a warning and doesn’t harm the apache service. But it is very annoying !

Here are the steps that I used to get it solved.

  • Open the terminal and type

    • sudo gedit /etc/apache2/httpd.conf

  • By default httpd.conf file will be blank. Now, simply add the following line to the file.

    • ServerName localhost

  • Save the file  and restart apache server

    • sudo /etc/init.d/apache2 restart