From owner-freebsd-questions Thu Jan 9 3:59:10 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4445237B401 for ; Thu, 9 Jan 2003 03:59:08 -0800 (PST) Received: from creon.profinet.sk (creon.profinet.sk [195.46.64.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF93943E4A for ; Thu, 9 Jan 2003 03:59:06 -0800 (PST) (envelope-from bsd@host.sk) Received: by creon.profinet.sk (Postfix, from userid 49759) id A858B13B661; Thu, 9 Jan 2003 12:58:54 +0100 (CET) Date: Thu, 9 Jan 2003 12:58:54 +0100 From: i4o beke To: freebsd-questions@freebsd.org Subject: apache, jail, 1 IP ... Message-ID: <20030109125854.B10927@creon.profinet.sk> Reply-To: freebsd@beke.sk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.21i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG problem description: - 1 internet ip address, let's say 1.2.3.4 ( hostname: main_user.sk ) - 5 friends. Sharing freebsd box. Everyone is heavily experimenting with apache so 5 jails running. - every jail has ip address, private range ip adress 192.168.0.x ( we were given only 1 public ip) - every user wants run his own apache, probably later also customers in his own jail, every user owns domain 'userX.sk' , - host box 1.2.3.4 runs dns, mail, www - dns record for 'user1.sk,user2.sk, ... userX.sk' points to 1.2.3.4 And now my problem. How to redirect incoming http request into jail, based on hostname request, transparently for www client? Right now i'm doing this through mod_rewrite on host box: RewriteCond %{HTTP_HOST} http://user1.sk RewriteRule ^/(.*)$ http://main_user.sk:81/$1 [R] RewriteCond %{HTTP_HOST} http://user2.sk RewriteRule ^/(.*)$ http://main_user.sk:82/$1 [R] RewriteCond %{HTTP_HOST} http://user3.sk RewriteRule ^/(.*)$ http://main_user.sk:83/$1 [R] and so on... Then ipnat: rdr ep0 1.2.3.4 port 81 -> 192.168.0.1 port 80 rdr ep0 1.2.3.4 port 82 -> 192.168.0.2 port 80 rdr ep0 1.2.3.4 port 83 -> 192.168.0.3 port 80 and so on... Problem with this solution is 'internal ip' instead of 'hostname' in address field of browser and bad accesibility to non 80 ports from behind firewall. I'd like to know, if exists more elegant solution, possibly port 80 solution. Mod_proxy doesn't seem to work in this case ( or i don't know how to properly use it ;-) -- i4o ----- End forwarded message ----- -- ico beke bsd at host.sk ico at beke.sk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message