How do I restart/reload Apache when it can't determine the domain name? [duplicate]

After installing Xdebug I tried to restart or reload Apache and I received the following message:

$ sudo /etc/init.d/apache2 reload
 * Reloading web server config apache2
apache2: Could not reliably determine the server's fully qualified domain
name, using 127.0.0.1 for ServerName

Solution 1:

Good news! Apache is restarting successfully. Apache just isn't sure where you want serve from, so it's choosing your localhost by default. To prevent this message from appearing, clarify that you want to serve from localhost by adding the following line into your /etc/apache2/apache2.conf file:

ServerName localhost