httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: Hosts behind router - dyndns
Date Wed, 07 Aug 2002 08:42:35 GMT
>From: Adam Lewis [mailto:alewis@dtp.homelinux.org]
>
>I have several machines with private IP addresses.  I have 1 
>IP address on a
>cable internet connection.  I have setup a few domain names 
>with dynamic dns
>(http://dyndns.org).  I have a router that does NAT for all 
>the machines so
>that they can get out to the internet.  I have port 80 forwarded to
>192.168.1.103 right now so if you point your browser to 
>dtp.homelinux.org
>you will see what's on 192.168.1.103.  If you pointer your browser to
>euclid.homelinux.org you will see what's on 192.168.1.103.  I 
>want to have
>dtp.homelinux.org goto 192.168.1.103:80 and euclid.homelinux.org goto
>192.168.1.101:80

I think Enric's solution is the simplest way to get things going. Since you have only one
public IP address, the router has no way to distinguish traffic for the two internal servers
(the packets are identical at the TCP/IP layer - it is only when you look into the HTTP attributes
to check the "Host" header that you see a difference. A network router can't do this).

So the solution (as per Enric) is to send all traffic to one server (e.g. 192.168.1.101) and
run it as a server for one site (e.g. euclid.homelinux.org) and a proxy to the other (e.g.
dtp.homelinux.org). To expand a little on the details:

- You need to install mod_proxy on the server euclid
- On that server you need to set up two name-based VHs:

NameVirtualHost 192.168.1.101

# This is the local server
<VirtualHost 192.168.1.101>
  ServerName euclid.homelinux.org
  DocumentRoot ...etc.
</VirtualHost>

# This is the proxy
<VirtualHost 192.168.1.101>
  ServerName dtp.homelinux.org
  ProxyPass / http://192.168.1.103
  ProxyPassReverse / http://192.168.1.103
</VirtualHost>

Now the euclid server will detect requests for euclid and serve them from the first VH. Requests
for dtp will be routed to the second VH and proxied to the dtp server.

A slight disadvantage of this approach is that all traffic has to go through euclid. This
might be a problem if both sites are busy. A workaround would be to make the busiest site
the main server and proxy to the quieter site..

Rgds,

Owen Boyle

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message