LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache giving the error :Could not determine the server's fully qualified domain name (https://www.linuxquestions.org/questions/linux-server-73/apache-giving-the-error-could-not-determine-the-servers-fully-qualified-domain-name-280677/)

rg.viza 08-15-2006 01:02 PM

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.

-Viza

jhooi 09-21-2006 08:52 AM

edit the httpd.conf file

Under section 2: main server configuration.

unhash # ServerName ....:80

and change the name after the ServerName to your FQDN name.

( hou can type hostname at the command line to see you server name)

in my case it is ServerName UHS:80

got_nix 09-23-2006 12:04 AM

Quote:

Originally Posted by bulliver
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

thanks for the info.. helpt alot :cool:

mcdude 01-05-2007 03:34 PM

I had the same problem.. fixed it like this:

Code:

vi /etc/apache2/apache2.conf
.. then add to the end of the file:

Code:

# ServerName
ServerName server.com

.. save & quit... restart apache:

Code:

/etc/init.d/apache2 stop
/etc/init.d/apache2 start

Hope it helps :)

LuLoh 02-21-2007 11:34 AM

I had the same message when I started apache2 server, and I added in my /etc/apache2/apache2.conf file the line:
Servername myservername.mydomain.net

as antken mentioned above, restarted the server and it didn't print out this ugly message anymore.

Thanks.

johnnygri 04-05-2007 11:13 AM

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

thomahawk 04-08-2007 03:09 AM

hello,

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! :)

t.

pitam 04-09-2007 02:21 AM

I am using fedora 6... but this should be applicable to all.

Go to System --> Administration --> Network

(that's same as the good old redhat-config-network)

go to the dns tab and enter the hostname as localhost.localdomain

now go to hosts ... and edit the hostnames as u like.

now edit the httpd.conf and add the line

ServerName yourservername

and lastly edit the line canonicalname

CanonicalName On

... and there u have it.... it will work from anywhere in da world wid ur ip .. AND u get ur own server name

ch41r 05-13-2007 06:52 AM

syddel, that worked for me too!

thanks a bunch :)

alkos333 07-05-2007 03:26 PM

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


LuLoh 07-06-2007 04:10 AM

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

alkos333 07-09-2007 08:21 AM

I've tried setting it up just like you said. My /etc/hosts now has only one line:
Code:

127.0.0.1 localhost laptop0
and httpd.conf ServerName attribute is set to alkos333.net, but I still get the same message.

redev 08-16-2007 03:24 AM

apache mod ssl on freebsd
 
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

#./apache.sh status
apache is not running

#./apachectl status
lynnx: not found

any ideas/solutions?

thanks before

AlucardZero 08-16-2007 08:49 AM

Quote:

any ideas/solutions?
Yes, post your own topic.

redev 08-20-2007 02:22 AM

sorry guys..


All times are GMT -5. The time now is 12:49 PM.