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.
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:
[root@foo.bar.com etc]# hostname
foo.bar.com
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
[root@foo.bar.com etc]# apachectl start
[root@foo.bar.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:
Code:
<ip address> foo.bar.com foo
in /etc/hosts.
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?
thanks
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:
Code:
me@laptop0:~/slackbuilds/packages$ cat /etc/HOSTNAME
laptop0.alkos333.net
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 <agulbra@nvg.unit.no> 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 localhost
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
#ServerName laptop0.alkos333.net
# to the server the response is coming from) it will use ServerName and
# ServerName dummy-host.example.com
me@laptop0:~/slackbuilds/packages$ su
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:
Servername alkos333.net
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.