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

One of the server I am using is running ubuntu. I am installing memcached on the server and every time I restart the web server I always have the error “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName”. If you are having the same error then this post is for you. This is how I solved the problem.

Open the cli and use the command to edit apache’s config file:

sudo gedit /etc/apache2/httpd.conf

The file is empty by default. Add the line:

ServerName localhost

Save the changes and restart the server:

apache2ctl restart

I hope it helps.