From owner-freebsd-questions Mon Jun 18 8:26: 2 2001 Delivered-To: freebsd-questions@freebsd.org Received: from cody.jharris.com (cody.jharris.com [205.238.128.83]) by hub.freebsd.org (Postfix) with ESMTP id 643FB37B403 for ; Mon, 18 Jun 2001 08:25:58 -0700 (PDT) (envelope-from nick@rogness.net) Received: from localhost (nick@localhost) by cody.jharris.com (8.11.1/8.9.3) with ESMTP id f5IGlXD90985; Mon, 18 Jun 2001 11:47:33 -0500 (CDT) (envelope-from nick@rogness.net) Date: Mon, 18 Jun 2001 11:47:33 -0500 (CDT) From: Nick Rogness X-Sender: nick@cody.jharris.com To: Simon Maycock Cc: freebsd-questions@FreeBSD.ORG Subject: Re: natd and Apache Port Based Virtual Hosting In-Reply-To: <20010618.7283600@barney.home.mrhagar.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On Mon, 18 Jun 2001, Simon Maycock wrote: > Can anyone tell me how I configure Port based Virtual Hosts in Apache > so that they correctly work with translated packets. It is my > understanding that all natd is doing is taking the external address, > striping it and adding an internal address. If this is the case then > I believe the following entries in my httd.conf should be working? > > # Use name-based virtual hosting. > # > #NameVirtualHost 192.168.1.201 > Listen 80 > Listen 8080 > Listen 8081 > Listen 8082 > # > # VirtualHost example: > # Almost any Apache directive may go into a VirtualHost container. # > The first VirtualHost section is used for requests without a known # > server name. > # > > ServerAdmin a@b.com > DocumentRoot /data/www/abc > ServerName 192.168.1.201:8080 > ErrorLog /data/www/abc/logs/error_log > TransferLog /data/www/abc/logs/access_log > > > > ServerAdmin a@b.com > DocumentRoot /data/www/xyz > ServerName 192.168.1.201:8082 > ErrorLog /data/www/xyz/logs/error_log > TransferLog /data/www/xyz/logs/access_log > > > This works fine from any internal host, but not from external ones, which > just default to the default site at port 80. ServerAdmin c@d.com DocumentRoot /data/www/cda ServerName 192.168.1.201 ErrorLog /data/www/cda/logs/error_log TransferLog /data/www/cda/logs/access_log > In an attempt to get this problem resolved I have set the firewall to > allow all and my rc.conf calls the my natd.conf file containing these > enteries. > > # > log yes > redirect_port tcp 192.168.2.201:80 80 > redirect_port tcp 192.168.2.201:8080-8082 8080-8082 > > Any help will be gratefully received. Is 192.168.1.201 your insdie IP of the same machine that carries your Public address (natd runs on it)? If so, then the redirect_port statements above are not necessary. Nick Rogness - Keep on Routing in a Free World... "FreeBSD: The Power to Serve!" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message