"Bergset" <sabergset@gmail.com> wrote in news:1128431351.134889.74430
@g49g2000cwa.googlegroups.com:
> NameVirtualHost 192.168.1.1
> <VirtualHost test.testdomain.com>
This is your problem. It should be:
<VirtualHost 192.168.1.1>
Otherwise, it will fail if DNS is unavailable.
> ServerAdmin my@email.com
> DocumentRoot /var/wwwdata/test.testdomain.com
> ServerName test.testdomain.com
This tells apache the name of the host so it can tell which VirtualHost to
deliver according to the Host: header sent by the client. It has nothing to
do with DNS, and doesn't even need to be resolvable (of course, you will
want it to be in DNS so people can find it from the Internet).
> ErrorLog /var/log/apache/host.test.testdomain.com-error.log
> TransferLog /var/log/apache/host.test.testdomain.com-access.log
> </VirtualHost>
> <VirtualHost anothertest.testdomain.com>
Same here.
> ServerAdmin my@email.com
> DocumentRoot /var/wwwdata/anothertest.testdomain.com
> ServerName anothertest.testdomain.com
> ErrorLog /var/log/apache/host.anothertest.testdomain.com-error.log
> TransferLog
> /var/log/apache/host.anothertest.testdomain.com-access.log
> </VirtualHost>
Few people have reason to configure the VirtualHost directive with a
hostname instead of an IP address. Those that do put themselves at the
mercy of DNS. If you use an IP address, your site will be more robust in a
number of DNS failure scenarios, including the one you outlined.