Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 09-23-2007, 12:00 PM   #31
LQ Newbie
Registered: Sep 2007
Posts: 1

Rep: Reputation: 0
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):


And then issue one command as root from the command line:

# domainname

As long as these two settings correspond all will be fine, virtual hosting will have no effect on this.

I found that doing # hostname 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.
Old 09-23-2007, 12:20 PM   #32
LQ Newbie
Registered: Mar 2007
Posts: 14

Rep: Reputation: 0
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 for ServerName
apache2: Could not determine the server's fully qualified domain name, using for ServerName

However, my server is working fine. That is, if you go to ... 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?

Old 09-23-2007, 12:24 PM   #33
LQ Newbie
Registered: Mar 2007
Posts: 14

Rep: Reputation: 0
Error FIXED under apache2 - ubuntu implementation

As described above, I put in


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
* Forcing reload of apache 2.0 web server... [ ok ]

So, the solution, as suggested, works fine.

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

Old 11-19-2007, 03:48 AM   #34
LQ Newbie
Registered: Nov 2007
Posts: 2

Rep: Reputation: 0

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:

Old 06-17-2008, 12:25 AM   #35
Registered: May 2008
Distribution: Centos; Ubuntu; Fedora
Posts: 98

Rep: Reputation: 15
Originally Posted by bulliver View Post
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 ( is the same as 'localhost'). It should still work fine, and you should be able to navigate to 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 .
Old 06-21-2008, 07:50 AM   #36
Registered: Jan 2006
Distribution: debian
Posts: 63

Rep: Reputation: 15
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 localhost



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.

Last edited by twlilinux; 08-15-2008 at 03:34 PM.
Old 02-22-2009, 04:04 PM   #37
LQ Newbie
Registered: Feb 2009
Location: Tennessee, USA
Distribution: Mac OSX-BSD
Posts: 5

Rep: Reputation: 0
Unhappy 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 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
httpd: Could not reliably determine the server's fully qualified domain name, using for ServerName
httpd not running, trying to start
(48)Address already in use: make_sock: could not bind to address
no listening sockets available, shutting down
Unable to open logs

I found the server name was set as
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
Old 02-22-2009, 04:22 PM   #38
LQ Newbie
Registered: Feb 2009
Location: Tennessee, USA
Distribution: Mac OSX-BSD
Posts: 5

Rep: Reputation: 0
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?
Old 03-04-2009, 03:18 AM   #39
LQ Newbie
Registered: Nov 2008
Posts: 1

Rep: Reputation: 0
try to this script, this should work

[me@linux]#echo> /etc/hostname
[me@linux]#/bin/hostname -F /etc/hostname
and restart apache.
Shutting down httpd: [ OK ]
Starting httpd: [ OK ]

Last edited by anugrah; 03-04-2009 at 03:19 AM.
Old 03-18-2011, 08:01 AM   #40
LQ Newbie
Registered: Nov 2010
Posts: 3

Rep: Reputation: 2
Hey just change the hosts.conf file.
EX- localhost.localdomain localhost put your server name .domain name.
Old 03-18-2011, 08:07 AM   #41
LQ Veteran
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
@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
Old 07-14-2011, 02:43 PM   #42
Registered: Jun 2011
Location: Sri Lanka
Distribution: centos,redhat,ubuntu
Posts: 90

Rep: Reputation: Disabled

please check this may be it will help you..
0 members found this post helpful.
Old 02-18-2012, 10:20 AM   #43
LQ Newbie
Registered: Feb 2012
Posts: 1

Rep: Reputation: Disabled
Smile A working solution

do following 2 changes:

in /etc/hosts
<ip_address> <domain_name>

and in httpd.conf
Servername <domain_name>:80
Old 10-04-2012, 02:00 PM   #44
LQ Newbie
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
Thumbs up Thanks!

bulliver, you are a god! Got my little problem fixed just by Googling the error output. Thanks!
Old 07-15-2013, 04:59 PM   #45
Registered: Sep 2006
Location: Sydney Australia
Distribution: fedora/Ubuntu
Posts: 114

Rep: Reputation: 17
Deleted message

Last edited by keirvt; 07-15-2013 at 05:01 PM.


apache, could, domain, error, fully, httpd, name, servers

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
squid FATAL: Could not determine fully qualified hostname. Please set 'visible_hostn tarakthakor Linux - Networking 5 12-04-2010 05:29 AM
Fully Qualified Domain Name tumana Linux - Networking 4 06-10-2004 02:58 AM
Apache: httpd: Could not determine the server's fully qualified domain name.. shirtboy Linux - Software 1 11-20-2003 03:47 AM
Fully Qualified Domain Names? MasterC Linux - Networking 7 05-19-2003 01:38 PM
http: can't could not determine the servers fully qualified domain name, using 127xyz s7nner Linux - Newbie 4 05-05-2003 06:18 PM

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration