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/)

serzz21 09-23-2007 12:00 PM

easy resolution.
 
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.

MJWhiteDerm 09-23-2007 12:20 PM

ServerName directive under Apache2 under Ubuntu
 
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?

Michael

MJWhiteDerm 09-23-2007 12:24 PM

Error FIXED under apache2 - ubuntu implementation
 
As described above, I put in

ServerName cthia.com

as an uncommented line, in the top of apache2.conf

Now, when I force reboot apache2, I get:

michael@carolyn-ubuntu:/etc/apache2/sites-available$ sudo /etc/init.d/apache2 restart
Password:
* Forcing reload of apache 2.0 web server... [ ok ]
michael@carolyn-ubuntu:/etc/apache2/sites-available$

So, the solution, as suggested, works fine.

This is NOT covered in the Ubuntu Linux Bible, or in The Official Unbuntu Linux book.

Michael

shame_nrw 11-19-2007 03:48 AM

Hi,

last post seems to be correct.

I got the same problem with an Apache 2.0.46.
I could resolved it with an thread from another forum:

http://www.wallpaperama.com/forums/h...-name-t23.html

Cheers
Sascha

tungvs 06-17-2008 12:25 AM

Quote:

Originally Posted by bulliver (Post 1438486)
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 :D.

twlilinux 06-21-2008 07:50 AM

I got the same error message in my debian server, but apache2 was able to start despite that.

To make the error message go away, I changed the following values:

/etc/hosts
120.0.0.1 localhost
$my_IP_address mydomain.com

/etc/hostname
mydomain.com

/proc/sys/kernel/hostname
mydomain.com

logout, then log back in, and type: apache2ctl restart

-------
My favorite websites:
Buy and sell class notes, old exams, papers, lab reports, admission essays.
Ask and answer Linux questions.
Read free books without walking to the library.

PhooD 02-22-2009 04:04 PM

Server Naming on a Mac
 
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

PhooD 02-22-2009 04:22 PM

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?

anugrah 03-04-2009 03:18 AM

try to this script, this should work

[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 03-18-2011 08:01 AM

Hey just change the hosts.conf file.
EX- localhost.localdomain localhost put your server name .domain name.

druuna 03-18-2011 08:07 AM

@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.

BTW: Welcome to LQ ;)

splinux 07-14-2011 02:43 PM

http://aslamnajeebdeen.com/blog/how-...rror-on-ubuntu


please check this may be it will help you..

onkarnidhi 02-18-2012 10:20 AM

A working solution
 
do following 2 changes:

in /etc/hosts
<ip_address> <domain_name>

and in httpd.conf
Servername <domain_name>:80

olystretch 10-04-2012 02:00 PM

Thanks!
 
bulliver, you are a god! Got my little problem fixed just by Googling the error output. Thanks!

keirvt 07-15-2013 04:59 PM

Deleted message


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