How To Fix Apache Could Not Reliably Determine FQDN
In this short guide I will show you how to fix an error happens on Apache-based server with message output: apache2: Could not reliably determine the server’s fully qualified domain name. 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. WikiPedia explains it as a domain name that specifies its exact location in the tree hierarchy of the Domain Name System a.k.a DNS. Commonly, FQDN has a format like something.domain.tld e.g: host.servermom.com.
When a user tries to restart Apache2 service using either one of these commands:
service apache2 restart
that user will then get error message saying:
* Restarting web server apache2 apache2: apr_sockaddr_info_get() failed for server apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName ... waiting apache2: apr_sockaddr_info_get() failed for server apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
here a screenshot pic taken from my playground server:
This kind of error can simply be ignored but it will be better to be fixed. The error message is just a warning and Apache should still work fine but once again, the solution is pretty simple and easy so you better fix it.
p.s: When I say “server” it refers to both VPS or Dedicated one.
How To Fix FQDN Issue On Apache
Step 1 – 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.
Step 2 – Now issue following command syntax:
Step 3 – You’ll now in Nano text editor. If you see a blank screen, just don’t worry it is normal. Now type following line in there..
Like this one:
Once done, save it and exit. In Nano editor the command to save should be Control+O while Control+X used to exit.
Step 4 – 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.
p.s: for CentOS users please read the guide here (in step 5).
Thank you SO MUCH!!!
I love you!!!!!
It helped me a lot, thank you!
changed my servername to localhost however message still shows up