How does Apache determine the fully qualified domain name?

I am using Apache2, and when I reboot / restart the server, I get this warning:

apache2: Could not reliably determine the server fully qualified domain name, using (my FQDN) for ServerName

Everything works fine, but I'm trying to figure out what causes the error. I grab the source to see if it can find it, but since my C is not very good ....

Some notes:

  • If I change the system host name, Apache uses the new host name
  • I have a set ServerName; it matches the host name
  • I have a static unique IP - dig (hostname)return (my ip), dig -x (my ip)returns (hostname)
  • My hosts file is correct.

Versions:

Apache / 2.2.9
Linux 2.6.24-23-xen x86_64
Description: Debian GNU / Linux 5.0 (lenny)

Any ideas?

+3
3

ServerName - <VirtualHost>? (, , ServerName <VirtualHost>)

Apache , , ServerName . , , , Apache ...

+8

Debian script/etc/init.d/hostname.sh, /etc/hostname. ( ).

ServerName vhost - my-computer.my-domain.ext, /etc/hosts

: /etc/hosts, FQDN. fqdn, localhost .

~$ echo "my-computer" > /etc/hostname
~$ echo "127.0.0.1 my-computer.my-domain.ext my-computer localhost" > /etc/hosts
~$ /etc/init.d/hostname.sh

:

~$ hostname
my-computer
~$ hostname --fqdn
my-computer.my-domain.ext

. , , .

+1

For more information about setting the hostname and fully qualified domain name to debian (which also prevents the warning), follow these steps: http://movealong.org/hostname.html

0
source

Source: https://habr.com/ru/post/1705760/


All Articles