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.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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):
ServerName example.com
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
Does the FQDN used as ServerName have to be different to the Virtual Domain names
Does the FQDN used as ServerName have to be different to the Virtual Domain names?
The first entry in this thread suggests they have to be different. In other words do you have to register a domain name just to give the server a name?
[me@linux]#echo yourdomain.yourdomain.com> /etc/hostname
[me@linux]#/bin/hostname -F /etc/hostname
and restart apache.
Shutting down httpd: [ OK ]
Starting httpd: [ OK ]
@sakibsyl: Please don't revive a 6 year old thread. This thread is already a mess as is, with 4 different people asking related question in the same thread over a period of 3 years.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.