Subject: Re: hostname problems
To: None <kpneal@pobox.com>
From: Martin Husemann <martin@duskware.de>
List: tech-net
Date: 02/23/2003 09:49:28
On Sun, Feb 23, 2003 at 12:23:48AM -0500, kpneal@pobox.com wrote:

> I'm thinking you can't do what you are asking to do without restarting
> Apache every time your IP changes.

Maybe. Ifwatchd(8) is your friend.

> For a totally different approach you may be able to get away with
> ipnat tricks to get around the dynamic-IP problem.

The standard solution probably is to have apache only listen on your 
internal 10.x network, at two (or four) ports. The standard http/https
ports for your internal network and arbitrary port(s), say 401, for
the external access. Then put something like this in your /etc/ipnat.conf:

rdr pppoe0 0.0.0.0/0 port http -> 10.x.x.x port 401

If I recall corectly the apache config allows a different DocumentRoot 
setting for each port you ask it to listen on.

For the "can't resolve 10.x.x." part: I've always run a caching internal name
server in such scenarios, that thinks it's authoritive for the internal
networks machine names and their reverse mappings. Then apache would query
this internal name server and get the right answers.

Martin