If you have Apache2 installed on a virtual server , you may have come across this. You change your config and go to restart apache…
But you get this status message about domains… and servernames… and 127.0.1.1. But things seem to be ok when apache restarts, websites are working as they should.
Well in order to get rid of that error you have to add this line of code
ServerName localhost
to
/etc/apache2/httpd.conf
Once you do this and restart apache you should find that there is no longer any status messages. You should now get…
# sudo /etc/init.d/apache2 restart
* Restarting web server apache2
… waiting …done.
Now before you restart your server after any config changes you will want to test your configured file first with the following command, and if everything is good this is what you should see…
#apache2ctl configtest
Syntax OK
if everything looks good , go ahead and restart , all should be well!
Read Also:

Brian Reich on April 29, 2010
Unless I’m missing something with your virtual server configuration, could the fact that your loopback address was configured to 127.0.1.1 instead of 127.0.0.1 be problematic?
Brian Reich´s last blog ..Use a Different Password for Insecure Websites
Like or Dislike:
0
0
Daniel Tisza-Nitsch on April 29, 2010
Actually, it’s got nothing to do with a Virtual Server.
The problem lies with the fact that *nix servers expect a correct “domain name” or hostname.
On a fresh install of *nix systems, often the default name will be set to localhost or 127.0.0.1. This is not a “correct” NAME (localhost is not a “real address” to a server, but something know as a loop-back address). Since many people set up their *nix environments for testing or development purposes, there is usually no need to ever change that.
The problem lies with the fact that Apache is expecting the server to be set up as if it was a fully / properly configured hosting server, and is just being picky about getting the information on the server set up correctly so that there are no loopholes or errors later on. For that reason, force setting the “ServerName” to something in the httpd.conf (or apache2.conf if you are using ubuntu) will bypass the step of checking the server for the domain name, since you manually set it up in the config file!
Like or Dislike:
0
0
to domain name on May 3, 2010
hi guys…
hi guysI would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well and i have start my own blog now, , thanks for your effort…
Like or Dislike:
0
0