You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Graham Leggett <mi...@sharp.fm> on 2000/04/12 12:36:51 UTC
Virtualhost problem
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
--
Re: Virtualhost problem
Posted by dean gaudet <dg...@arctic.org>.
On Wed, 12 Apr 2000, Graham Leggett wrote:
> To configure this, I put this in /etc/hosts:
>
> 10.0.0.1 www.domain.com
> 192.168.0.1 www.domain.com
i doubt that works right.
> <VirtualHost www.domain.com:80>
use <VirtualHost 10.0.0.1:80 192.168.0.1:80>
-dean