Apache giving the error :Could not determine the server's fully qualified domain name
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
two things need to correspond, the computers domainname and the domain name configured in http.conf, the main apache configuration file that all the others revolve around.
Add this line to the main apache config file (i put it right at the top, the first uncommented line):
And then issue one command as root from the command line:
# domainname example.com
As long as these two settings correspond all will be fine, virtual hosting will have no effect on this.
I found that doing # hostname example.com worked without having to edit the config file but then u r calling your host the name of your domain which is ok as long as u only have one host in your domain.
It's a wee bit frustrating ... but the implementation of apache2 under ubuntu 6.06 seems to be different than referenced above.
Specifically, httpd.conf is a place holder file only. I looked in /etc/apache2/apache2.conf and a servername directive is nowhere to be found.
I am getting a similar message when I restart apache:
* Forcing reload of apache 2.0 web server... apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
However, my server is working fine. That is, if you go to www.cthia.com ... it correctly points to the default directory and index.html on my computer. The other virtual hosts that I'm running are not showing up, yet. However, that is an error relating to my router and external IP address range, I believe.
Any ideas where the problem for this error might lie?
If you just want to play around with apache on your local system then you should have just put "ServerName localhost" in httpd.conf (actually it's there, just commented out). All apache is telling you with that error is that it didn't find a ServerName in your conf file, so it is using the default (127.0.0.1 is the same as 'localhost'). It should still work fine, and you should be able to navigate to http://127.0.0.1/ or http://localhost/ and see the test page.
PS: ServerName doesn't belong in /etc/hosts, it goes in httpd.conf
Thanks, bulliver. It works. My httpd.conf contains nothing, so I don't know where to start. Writing down the "ServerName localhost" takes the problem away .
How can I tell Apache which httpd.conf file to use?
I have a similar problem. I am trying to set up a Mac Mini at a server farm using colocation hosting and have the FQDN pointing to a name server at the server farm, and their name server provides the IP address of my Mac Mini. It works fine for a single domain name but I want to use several virtual hosts. I set this up initially using OS X Leopard Server but it would not resolve the virtual domains so I gave up and tried to do it directly in BSD Linux.
I edited the file /etc/httpd/httpd.conf file and added specs for the ServerName and Virtual Hosts per Apache.org specs. I think you have to restart httpd to activate the conf file. I used Apachectl -k graceful and got
httpd: apr_sockaddr_info_get() failed for PhooD.com
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
httpd not running, trying to start
(48)Address already in use: make_sock: could not bind to address 127.0.0.1:9010
no listening sockets available, shutting down
Unable to open logs
I found the server name was set as www-server.PhooD.com
I added the server's domain name to the /etc/hosts file (as above) and got rid of the first two lines of this error but the rest remains.
top reveals that http is running but it is not recognized by:
httpd -k stop
httpd (pid 42?) not running