Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D0AC9895 for ; Thu, 14 Mar 2013 16:16:03 +0000 (UTC) Received: (qmail 13123 invoked by uid 500); 14 Mar 2013 16:16:00 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 12949 invoked by uid 500); 14 Mar 2013 16:15:59 -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 12925 invoked by uid 99); 14 Mar 2013 16:15:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Mar 2013 16:15:58 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ryanmerrell@gmail.com designates 209.85.128.180 as permitted sender) Received: from [209.85.128.180] (HELO mail-ve0-f180.google.com) (209.85.128.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Mar 2013 16:15:53 +0000 Received: by mail-ve0-f180.google.com with SMTP id jx10so1825095veb.39 for ; Thu, 14 Mar 2013 09:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=VVoz9I1PlWxdZWLXUj3z1mWmd9Vj/Q9HnjqyaRhMXko=; b=YXa6xfUldK90C66lKEGW7C2y/4HtLTO6DxdPZKa/UZhee+IKe19ruBLO831nE/sTVL oJHLocGnRUVFDfYAFHUF4U03jG0XmjgmN4olwBqteM4mdwOuOLlbF/FUSG8uE6H/bZS7 aOMyqX7ddDfvw0HGq4ddDjdIh1jBMQs943zMpLrUC9q0pEQr0O7jk4t9N+63BQA2uRRW qyk+V0ePG7gitbO3UQ/bEnUZDu5ELVA26OPRD3m3vYaAfUJ8k7JW8THO82EtVOsVvmws F1ns207aJ9OhZx0lXLJ6rB91I0rmT8ULkSUTDOoc/1N+1OP3LRUIWbzHgOm84JWJDM1H J/CQ== MIME-Version: 1.0 X-Received: by 10.58.253.161 with SMTP id ab1mr2435126ved.55.1363277733066; Thu, 14 Mar 2013 09:15:33 -0700 (PDT) Received: by 10.220.28.204 with HTTP; Thu, 14 Mar 2013 09:15:32 -0700 (PDT) Date: Thu, 14 Mar 2013 10:15:32 -0600 Message-ID: From: Ryan Merrell To: users@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] Struggling with Reverse Proxy Configuration for Server with multiple subdomains Our web application (an LMS) uses three subdomains to serve its content: home.example.com training.example.com shared.example.com These are all vhosts running off of 1 server. My end goal is to use mod_proxy as a reverse proxy and to load balance between two servers. Until we can make changes to the app to be more tolerant to HA systems, the load balancer will most likely need to be Active/Passive between two back end servers. I'm new to mod_proxy, so I've started off with just trying to set up a 1:1 reverse proxy, meaning one proxy server sending all traffic to one server only. But I can't seem to get that working. Every example I can find for setting up a reverse proxy uses examples like "example.com/$FUNCTION" as the public side and "$FUNCTION.example.com' as the private. For example, www.example.com/shared on the proxy goes to shared.example.com on the private side. www.example.com/training on the proxy goes to training.example.com on the private side. I can't do this without considerable changes to how our application works. What i need is for home.example.com on the proxy to go to home.example.com on the back end. Same for shared and training. On the proxy I tried configuring 3 vhosts (home.example.com, shared.example.com, and training.example.com). An example is like the following:(proxy is 192.168.2.210 and host 1 is 192.168.2.211) NameVirtualHost 192.168.2.210:80 ServerName home.example.com ProxyRequests Off ProxyPreserveHost On ProxyPass / http://192.168.2.211/ ProxyPassReverse / http://192.168.2.211/ Order deny,allow Allow from all I have the same thing for training and shared as well. Then on the backend server, I have a standard vhost configuration for the three vhosts (meaning if I change my dns to resolve to 192.168.2.211, the web page functions as expected). With this set up, and my DNS resolving to the proxy for all three subdomains, I can pull up the few items that loads from "home", but anything being requested from shared (training isn't used on the login screen) gets a 404. When I look at the backend server looks, the 404 is looking in home's document root instead of Shared. So it seems that all requests being passed to the back end server are going to the default vhost and not based off of the Host name.Everything I can find regarding this type of error have lead to making sure the NameVirtualHost and VirtualHost directives match, which they do and it still seems to go to the first vhost listed. So a couple questions I have are 1) Is what I'm planning to accomplish even doable? I figured if it was I'd at least be able to find just one example out on the Internet, but I haven't been able to, which has created doubt as to whether I'm fully understanding how mod_proxy works. 2) If it is doable, what config changes do I need to make so it uses the hostname instead of the default vhost? 3) If I can get this part to work, am I going to have any problems in getting an Active/Passive load balancer set up? --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org