Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Mar 2004 19:48:20 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        "Eli K. Breen" <eli@gopostal.ca>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: natd & virtual hosting
Message-ID:  <20040322194820.GA21648@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <405F3B3E.6040404@gopostal.ca>
References:  <405F2344.4050309@gopostal.ca> <405F3657.7080005@bgp4.net> <405F3B3E.6040404@gopostal.ca>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Mon, Mar 22, 2004 at 11:15:10AM -0800, Eli K. Breen wrote:
> 
> Janet Sullivan wrote:
> > > I'm trying to host a few services under a few different domain names and
> > > need to be running multiple webservers to do it (apache 1.3x and 2.x).
> > >
> > > If I have a single IP, will nat with FreeBSD 4.9 allow me to separate
> > > requests by domain name even if they share an IP?
> >
> >NAT works with IP addresses.  Why can't you just use Virtual Hosts in 
> >Apache?  Do you really need to run both versions?  
> 
> Yes. Unfortunately. (Slash does not run on 2.x, many of the sites 
> require 2.x)
> 
> I am already running virtual hosts on apache, there are many more than 
> two sites, I've just simplified it for the sake of clarity.
> 
> >If so, what you need 
> >to do is something like this:
> >
> >Apache 1.3x runs on port 80
> >Apache 2.x runs on port 8080
> >
> > redirect 192.168.5.1:80 to 123.123.123.123:80
> > redirect 192.168.5.2:80 to 123.123.123.123:8080
> >
> 
> Also not an option, have tried this before, all manner of people run in 
> to access problems. Giving out your website as www.foo.com:8080 is just 
> weak. (redirects from a :80 fare no better due to the access problems).
> 

A good trick is to set up all of the virtual hosts you need in the
server listening on port 80 (presumably this is your apache-1.3.x
server), and then use mod_proxy to fetch the content from the server
on port 8080 (presumably the apache-2.0.x server).  Something like:

    <VirtualHost *:80>
        ServerAdmin  webmaster@example.com
        ServerName   www8080.example.com
        DocumentRoot "/usr/local/www/www8080.example.com/"  # Not sure if this
                                                            # is necessary
    
        <IfModule mod_proxy.c>
            ProxyPass        / http://www8080.example.com:8080/
            ProxyPassReverse / http://www8080.example.com:8080/
        </IfModule>
    </VirtualHost>
    
	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAX0MEdtESqEQa7a0RAiBbAJ0YC2y9z4p1ShPp6JTZCClBQSG2iACfViD/
5PnvD9jhCxo+SPM+T9TN3FI=
=f+Qi
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040322194820.GA21648>