How to fix Apache – “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName” Error on Ubuntu
You might probably faced the same following error while you were restarting the Apache server on Ubuntu.
root@testserver:~$ vi /etc/init.d/apache2 restart
* Restarting web server apache2
apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
… waiting apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
This kind of error is not categorized as crucial but pretty necessary to get fixed to avoid annoying message each time a user restarts or reloads Apache web server. The Fully Qualified Domain Name or also known as FQDN is basically simply another name for the complete domain name for a specific computer, or host, on the Internet.
To fix that problem,
Login to your server via SSH. You can use either Putty on Windows or Terminal if you are on Mac or Linux. If you can, you better login as root or as a user with root privilege.
you need to edit the httpd.conf file. Open the terminal and type,
By default httpd.conf file will be blank. Now, simply add the following line to the file.
Save the file and exit from vi editor.
Next, simply restart Apache2 service. There are two most common commands used to accomplish that task. You can use either..
service apache2 restart
That’s it. Now you should see the error has gone 🙂