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.
Actually this error won't stop the server from starting and serving web pages. You have a problem which is breaking your server _and_ your hostname is not set with the ServerName directive.
I have one that runs fine and gets this error, that's how I got to this thread 8)
I set the ServerName directive with the same name that gets returned with the command:
[email@example.com etc]# hostname
and server is now quiet. As well, it still works. If your server is registered in dns, you don't need to do this.
Getting back to the server not starting...
How do you know it's not starting?
Can you see it in your process list?
Can you browse it from the local machine?
If you can't see it in the process list it's really crashing. There should be some pertinent information in the error log.
What happens if you do an
[firstname.lastname@example.org etc]# apachectl start
[email@example.com etc]# apachectl --configtest
Does it print something like:
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
If so it means the server is in fact running and you have an apache host configuration issue that's not letting you browse it, or you are typing the wrong stuff in the browser. This error from configtest means server won't start because it's configured to bind to port 80 and it can't bind to port 80 because 80 is already in use (most likely by the apache process that's running.
hope this helps.
I'll follow up if you provide more diagnostic info.
This is not right. The hostname of a machine should not be a FQDN, that is what /etc/hosts is for. In your case it looks like you want to run 'hostname foo' at the command line and put a line such as:
<ip address> foo.bar.com foo
This all depends on you actually owning the 'bar.com' domain, and having DNS pointing to the ip address you are running apache on, which I suspect you don't...you cannot make up an arbitrary ServerName using a FQDN
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
hi there. i've recently installed apache2 and am getting the same. my hostname and the servername in the default config are both the same (i added the servername to the server config) . have i missed a step?
I have the similar problem. However, my setup might be slightly different from what I have read. I run one box with several (named based) virtual servers. I am not sure, but I think the Apache message started to appear after I did a Debian apt-get upgrade, which upgraded mostly everything on my server...
The functionallity is ok, even though the Apache message keeps comming.
The Apache.conf-file is setup with no global ServerName-directive. I don't want a fallback if a lookup fails. Instead, I have a NameVirtualServer *:80 which servers as a catch-all directive. Then, I have one VirtualHost-block for each of the virtual servers. Inside this block I have the ServerName directive which corresponds to the virtual server. This setup works ok, but as I said, the Apache-message "suddenly" keeps comming up, and I don't know why... :|
One more thing, though, for the curious. To have name-based virtual servers work as I described, you have to put the names of the virtual servers in your hosts file. Since Apache uses reverse lookup to find out it's server name, I also configured bind/named to be a local authorative on the LAN network. This also has to do with Sendmail, which is rather strict on lookups.
If someone has any comment or hunch to where to start looking, please post!
I read the whole thread and tried following some of the instructions people suggested. Unfortunately, none of them worked for me. Here is my set-up:
I own alkos333.net, but since I'm running apache on my laptop, I don't have a
stable ip address to point the domain name to.
Here is some information about the set-up:
me@laptop0:~/slackbuilds/packages$ cat /etc/HOSTNAME
me@laptop0:~/slackbuilds/packages$ cat /etc/hosts
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server. Just add the names, addresses
# and any aliases to this file...
# By the way, Arnt Gulbrandsen <firstname.lastname@example.org> says that 127.0.0.1
# should NEVER be named with the name of the machine. It causes problems
# for some (stupid) programs, irc and reputedly talk. :^)
# For loopbacking.
127.0.0.1 laptop0.alkos333.net laptop0
# End of hosts.
me@laptop0:~/slackbuilds/packages$ grep ServerName /etc/apache/httpd.conf
# ServerName allows you to set a host name which is sent back to clients for
# to the server the response is coming from) it will use ServerName and
# ServerName dummy-host.example.com
root@laptop0:/home/me/slackbuilds/packages# apachectl restart
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
I've a dynamic IP, too, and in my /etc/hosts file I didn't include the 'fully qualified domain name' like your laptop0.alkos333.net laptop0. For localhost, I have only a line like:
127.0.0.1 localhost laptop0
and, in my /etc/apache2/apache2.conf I've added the line like:
all, need your help for the problem
i am installing snort @ freebsd6
however stuck on the apache.
i successfully installed apache+mod_ssl-1.3.37+2.8.28, however when starting the apache (./apachectl start), it gives just nothing.
no error though, but not running as well