Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 42162 invoked from network); 28 Jun 2005 08:15:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Jun 2005 08:15:17 -0000 Received: (qmail 6050 invoked by uid 500); 28 Jun 2005 08:14:59 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 5943 invoked by uid 500); 28 Jun 2005 08:14:58 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 5782 invoked by uid 99); 28 Jun 2005 08:14:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2005 01:14:57 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [219.88.242.2] (HELO dbmail-mx3.orcon.net.nz) (219.88.242.2) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2005 01:14:56 -0700 Received: from HOUSTON (60-234-137-50.bitstream.orcon.net.nz [60.234.137.50]) by dbmail-mx3.orcon.net.nz (8.13.2/8.13.2/Debian-1) with SMTP id j5S8GSjP029442 for ; Tue, 28 Jun 2005 20:16:30 +1200 Message-ID: <022401c57bb9$695743a0$0f00a8c0@HOUSTON> Reply-To: "Cameron Beattie" From: "Cameron Beattie" To: References: Date: Tue, 28 Jun 2005 20:14:30 +1200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: ClamAV version 0.85.1, clamav-milter version 0.85 on dbmail-mx3.orcon.net.nz X-Virus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] RewriteRule question: forward requests from one Apache server to another X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Ok so I checked httpd.conf on server 1 and I stupidly hadn't included RewriteEngine On. I've done that and now I get served up a site from server 2, but it's the wrong site. I have two virtual hosts set up as follows: Server 1 NameVirtualHost *:80 ServerName server.mydomain.com RewriteEngine On RewriteRule ^/(.*) http://60.234.nnn.nn:8008/$1 [L,P] ServerName otherserver.mydomain.com RewriteEngine On RewriteRule ^/(.*) http://60.234.nnn.nn:8008/$1 [L,P] Server2 NameVirtualHost *:8008 ServerName server.mydomain.com DocumentRoot /var/www/html ServerName otherserver.mydomain.com DocumentRoot /var/www/html2 When I browse to http://otherserver.mydomain.com I get served up the http://server.mydomain.com site. This is the same site that I get served if I browse to http://serveripaddress:8080. So I don't think the host header is being passed properly from server 1 to server 2. Any suggestions? Regards Cameron ----- Original Message ----- From: "Boyle Owen" To: Sent: Tuesday, June 28, 2005 6:58 PM Subject: RE: [users@httpd] RewriteRule question: forward requests from one Apache server to another > -----Original Message----- > From: Cameron Beattie [mailto:kjcsb@orcon.net.nz] > Sent: Dienstag, 28. Juni 2005 04:50 > To: users@httpd.apache.org > Subject: [users@httpd] RewriteRule question: forward requests from one > Apache server to another > > > I am trying to set up the following configuration: > 1. Apache server with public IP address > 2. Apache server behind NAT with no public IP address > 3. Router with public IP address with port forwarding set up > for port 8008 > to Apache server 2 > 4. Public DNS record server.mydomain.com resolves to IP > address of server 1 > > When a user browses to server.mydomain.com I want a web site > to be served up > from from server 2. > > I have set the following up in httpd.conf on server 1: > > ServerName server.mydomain.com > RewriteEngine On > RewriteRule ^/(.*) http://60.234.nnn.nn:8008/$1 [L,P] > > > I have set the following up in httpd.conf on server 2: > > ServerName server.mydomain.com > DocumentRoot /var/www/html > > > I can access the website locally by accessing the site on > server 2, but not > through server 1. If I enter http://server.mydomain.com I > just get the > default apache homepage, rather than the index.phtml page > that I want to be > served up. If I enter http://server.mydomain.com/index.phtml > I get a 404 > error. I guess you left the usual doc-root pointing to htdocs in the main part of the config (outside the VH). So if you get the default page then it's not the RewriteRule - the request is not getting into the VH container. Did you do: NameVirtualHost *:80 to tell apache to use name-based virtual-hosting? Before worrying about rewriting, get the VH working: comment out the Rewrite rules, stick a temporary docroot in the VH container and check you can hit it. Rgds, Owen Boyle Disclaimer: Any disclaimer attached to this message may be ignored. > > I guess my rewriterule is wrong but I'm not sure how to fix > it. Any help > would be appreciated. > > Regards > > Cameron > > > --------------------------------------------------------------------- > The official User-To-User support forum of the Apache HTTP > Server Project. > See for more info. > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > " from the digest: users-digest-unsubscribe@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org > > Diese E-mail ist eine private und pers�nliche Kommunikation. Sie hat keinen Bezug zur B�rsen- bzw. Gesch�ftst�tigkeit der SWX Gruppe. This e-mail is of a private and personal nature. It is not related to the exchange or business activities of the SWX Group. Le pr�sent e-mail est un message priv� et personnel, sans rapport avec l'activit� boursi�re du Groupe SWX. This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org