Fix Apache2 error "Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName"

Sometimes when we start or restart Apache2, we get the following error in the terminal:

Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

Which means:

The correct domain name for the server could not be determined, 127.0.0.1 will be used as ServerName

To solve it we simply must execute the following command:

echo "ServerName localhost" >> /etc/apache2/conf.d/fqdn

The above command must be executed with administrative privileges, either using the account of root or putting at the beginning of the command sudo

This will be enough to solve the problem, from now on when they start or restart Apache2 they will no longer show that error.

regards


Add as preferred source in Google