httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <minf...@sharp.fm>
Subject Virtualhost problem
Date Wed, 12 Apr 2000 10:36:51 GMT
Hi all,

I have a problem that I am trying to solve in an elegant way, but I am
stuck.

I have two mirrored machines, each running Apache and serving the same
set of websites. One particular virtual host is causing a problem - due
to a collosal design flaw in the network, the address
http://www.domain.com on the inside of the network goes to a different
IP address to http://www.domain.com as seen by the internet. These two
IP addresses are on the same box, but different LANs.

To configure this, I put this in /etc/hosts:

10.0.0.1	www.domain.com
192.168.0.1	www.domain.com

I then Listen and NameVirtualHost like so:

Listen 10.0.0.1:80
Listen 192.168.0.1:80
NameVirtualHost 10.0.0.1:80
NameVirtualHost 192.168.0.1:80

And I define a Virtualhost like this:

<VirtualHost www.domain.com:80>
  ServerName www.domain.com
</VirtualHost>

This configuration doesn't work. When Apache starts, it complains there
are no virtual hosts for 192.168.0.1. When an attempt is made to connect
to http://www.domain.com on the 192.168.0.1 address, Apache serves the
default global site, instead of the virtualhost.

>>From the way I understand it, Apache should pick up the fact that
www.domain.com resolves to two IP addresses, and then notice that both
IP addresses are defined as NameVirtualHost's. Apache should in turn
match requests for www.domain.com regardless of either IP address being
involved. Unfortunately <VirtualHost> seems to insist on binding to one
IP address only even when multiple IP addresses are specified.

Can anyone see a workaround for this?

Regards,
Graham
--

Mime
View raw message