0

I set Centos 6.3 up on a Rackspace box, using a static IP address (not a FQDN). I will be setting up virtual hosts on this box, and it seems to be working fine, but when I restart the HTTPD server, I get an error message "could not reliably determine the server's fully qualified domain name, using xx.xxx.xx.xx for ServerName" (xx.xxx.xx.xx is the static IP address for the server).

My /etc/hosts has the following in it:

27.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
xx.xxx.xx.xx    name-used-for-rackspace

name-used-for-racspace is a name (not a FQDN) I used when I created the server (you have to enter a name).

I assume that I may not have to change anything in /etc/hosts, but what do I put in httpd.conf? right now, I have the following in that file:

NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot /var/www/html
    ServerName localhost 
    <Directory /var/www/html>
            allow from all
            Options +Indexes
    </Directory>
</VirtualHost>

I also tried setting ServerName to xx.xxx.xx.xx, but I got the same error message.

EastsideDev
  • 6,257
  • 9
  • 59
  • 116

2 Answers2

0

This error is because you are not using a FQDN. It should not affect the operation of the webserver.

To get rid of the message on startup you'd need to configure your hosts file with the correct domain and IP address. Your httpd.conf should also use the same name (where you have localhost specified).

As long as your server is starting and you don't plan on assigning a domain to your webserver, this error can be ignored.

Example virtual host with FQDN:

<VirtualHost *:80>
ServerName www.domain.net
ServerAlias domain.net *.domain.net
ServerAdmin administrator@domain.net
DocumentRoot "/home/domain/htdocs"
<Directory "/home/domain/htdocs">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
</Directory>
CustomLog "/home/domain/logs/access-www.log" common
ErrorLog "/home/domain/logs/error-www.log"

        <IfModule mpm_peruser_module>
          ServerEnvironment apache apache
        </IfModule>
</VirtualHost>

Example hosts file:

127.0.0.1       localhost       localhost.localdomain gentoo1
x.x.x.x         gentoo1.domain.net
Ben Ashton
  • 1,385
  • 10
  • 15
  • My server is working fine. I was just wondering if there's a way to get rid of the error message. – EastsideDev Oct 11 '12 at 19:36
  • Not unless you use a valid FQDN. See also http://stackoverflow.com/questions/9541460/httpd-could-not-reliably-determine-the-servers-fully-qualified-domain-name-us – Ben Ashton Oct 11 '12 at 19:54
-1

You need to configure the network connection with your static IP, see reference below. Otherwise, your web server is working, but it's not accessible externally.

https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Configuring_IPv4_Settings.html

Then put the static IP in the httpd.conf after server name.

  • You should probably read the question and answers/comments to date. Your answer does not address the question. I already have the static IP address in httpd.conf, and I can access it fine externally. I have several virtual hosts on it, using FQDNs, and they are working fine. The issue is how I get rid of the warning message about the missing FQDN for the main server. The answer is that there is no way to do it. – EastsideDev Jan 29 '13 at 20:44