Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting message AH00558: apache2:

Tags:

apache

ubuntu

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

I am a newby installing Ubuntu Can someone help on the commands I need to set this up? I already tried vim /etc/apache2/apache2.conf and adding localhost but I am still getting message when I restart Apache2 server.

like image 680
Blurocket9 Avatar asked Sep 11 '15 06:09

Blurocket9


2 Answers

Fast but not so elegant solution:

Navigate to the file - apache2.conf, i would use a terminal, here the steps:

  1. cd /etc/apache2/

    2.vim apache2.conf ( or pluma apache2.conf, if you are not a vi-geek )

  2. Write on the bottom:

    • ServerName localhost
  3. Save the file and restart apache, with following commands in the terminal:

    • /etc/init.d/apache2 restart You can use some UI or other commands like "service apache2 restart".

Just for the case, you can make a check, to see ether this directive isn't just disabled in some of the configuration files:

  • grep -inRH "ServerName " /etc/apache2/ | grep "\s#"*

Now the error is gone. You need root-rights for all this steps or use "sudo" instead.

Hope i could help you. Cheers.

like image 101
Denis Komnenovic Avatar answered Sep 21 '22 02:09

Denis Komnenovic


Run the following command:

apachectl -t -D DUMP_INCLUDES

to determine path to your httpd.conf configuration file, then edit that file and uncomment (or add) line which should specify value for ServerName option, e.g.

ServerName localhost

For the web server, use the registered DNS name (e.g. example.com).

If your host doesn't have a registered DNS name, enter its IP address here.

Then restart your Apache as usual, e.g. apachectl graceful.

like image 45
kenorb Avatar answered Sep 25 '22 02:09

kenorb