Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've never encountered this error before. And secondly I'd like to know how you folks debug your apache configurations.

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

In my Virtual Host configuration I do have these lines:

ServerName  example.com
ServerAlias www.example.com

(of course it has my actual info in there)

So I guess my question is, why wouldn’t apache be able to determine my fully qualified domain name?

share|improve this question

3 Answers 3

up vote 6 down vote accepted

check your /etc/hosts file. It should look something like this:

127.0.0.1     localhost
a.b.c.d       www.example.com

The first line should already be there, you only have to add the second line with your values.

share|improve this answer
    
did you mean /etc/hosts? –  lamcro Aug 7 '10 at 16:59
    
yes. thanks. i've corrected it in the answer. –  Christian Aug 12 '10 at 12:30

I think it's because you need to have "ServerName" declared outside vhost configuration, in the apache2.conf and the ServerName value declared in the /etc/hosts

share|improve this answer

In addition to the points already mentioned (/etc/hosts and the ServerName directive outside a vhost) it doesn't hurt to have the hostname value set properly for the system. Use the hostname command (as root or with sudo) to set it. (If you do this without doing the other two, the errors will continue, but it will replace "Using 127.0.0.1 for ServerName" with "Using [the value of hostname] for ServerName".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.