TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:19847] Two webservers on one machine?



Thank you for the informative post...comments below...

On Wed, 26 Jul 2000, Dave Sherohman wrote:

> IP-based virtual hosts require you to assign a separate IP address for each
> distinct host.  This has the distinct advantage of always working for all
> clients.

How does one configure a machine to have more than one IP address?

> Name-based virtual hosts are marginally more complex to set up (you need one
> extra command in httpd.conf to tell apache that you're using this method),
> but their primary drawback is that they're dependent upon the client sending
> a Host: header, which was not added to the HTTP spec until version 1.1.
> This is easy enough to work around (have a default top page to catch HTTP 1.0
> clients, ask them where they intended to go, and redirect them to the
> appropriate path; and only use relative paths in your links), but at a slight
> cost of inconvenience for users with old browsers.

I read this on the hosting company's page I mentioned earlier. They said
this affected Netscape 1.1 and lower...

> > so, I am wondering if I could configure the
> > computer as multipe domain names, then pass one of the domains off to the
> > other server...
> 
> How about setting up apache on port 80, AOL server on 81 (or wherever),
> configure apache for virtual servers of whichever flavor, and having apache
> issue redirects for requests into the server you want AOL handling?  (Doing
> this for the top-level index or selected pages is trivial.  Doing it for all
> requests to that hostname may be more complex; I don't know offhand...)

mod_rewrite might be able to handle this task. In fact, mod_rewrite can
even be used to set up virtual hosts without using an apache Virtual Host
directive!

Perhaps I could do something like this:

Configure a virtual host in Apache as bar.com to be my AOLserver, then
create a rewrite rule with mod_rewrite that sends the request to AOLserver
if the host matches bar.com...

something a bit like...

RewriteRule ^(bar\.com) $1:81

> Another option:  If you're doing IP-based virtual hosts and you have an
> ipchains packet filter in place, you should be able to do this with port
> forwarding.  (Redirect packets for aol.host:80 to aol.host:81.)

This sounds promising too...

My hacker mind loves this puzzle! It's so convoluted and...down right
subversive! Who'd want to run two webservers on one machine ANYWAY?!
MUhahahahah!

Luke