Problem
apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

Solution
This is not an error, only a warning.

To fix this in Ubuntu 14.04 LTS or later or earlier, type the following:

echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/fqdn.conf
sudo a2enconf fqdn

To fix this in Ubuntu 12.04 LTS or earlier, type the following:

$ echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn
ServerName localhost
$ sudo service apache2 restart