You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Charles W Buege <cb...@moreycorp.com> on 2014/01/09 22:47:46 UTC

[users@httpd] Proxy questions - part 2

Yehuda - 

I partially understand what you're saying, but I also want to make 100% 
sure my question is being answered.  Maybe this will make my question a 
bit clearer.

In the attached image (ProxyExample.jpg), I want to setup a proxy server 
(Physical Server 1).  What I want is if someone tries to access any of the 
following web sites, they pass through Physical Server 1 prior to getting 
to the actual system:
www.mycompany.com
anothersite.mycompany.com
thirdsite.mycompany.com

Now when someone from the outside world goes to 'www.mycompany.com' (which 
I presume via DNS matches the IP address of Physical Server 1), I'd like 
the proxy server to pass along the request to Physical Server 2.

I'd also like it to happen where if Physical Server 4's Apache instance is 
down for maintenance (backups, year end processing, etc.), that the Proxy 
Server (Physical Server 1) can display a message saying that the site is 
down for maintenance.  I'm presuming this would be handled via the 
'ErrorDocument 503' that you mentioned in your last e-mail, yes?

I also presume that the DNS entries for www.mycompany.com, 
anothersite.mycompany.com, and thirdsite.mycompany.com would all have the 
same IP address and then the Proxy Server (Physical Server 1) would play 
'traffic cop' and then forward the necessary traffic to the proper host 
behind the scenes.

Is what I am describing here what a proxy server can do for me?  Am I 
getting this concept correct or am I completely missing something?  As I 
said previously, proxy and such are completely new to me.

Also if anyone wants to point me towards somewhere where I can learn more 
about this (web site, books, etc.) so I'm not cluttering up this mailing 
list with newbie questions, please feel free to point me that way.

Thank you,
Charles










This e-mail, including attachments, may contain information that is 
confidential and/or proprietary, and may only be used by the person to 
whom this email is addressed. If the recipient of this e-mail is not the 
intended recipient or an authorized agent, the reader is hereby notified 
that any dissemination, distribution, or copying of this e-mail is 
prohibited. If this e-mail has been delivered to you in error, please 
notify the sender by replying to this message and deleting this e-mail 
immediately.


Re: [users@httpd] Proxy questions - part 2

Posted by Yehuda Katz <ye...@ymkatz.net>.
On Thu, Jan 9, 2014 at 4:47 PM, Charles W Buege <cb...@moreycorp.com>wrote:

> Now when someone from the outside world goes to 'www.mycompany.com'
> (which I presume via DNS matches the IP address of Physical Server 1), I'd
> like the proxy server to pass along the request to Physical Server 2.
>

Correct. This is my basic Virtual Host template adapted to your example (I
tested it too):
<VirtualHost www.example.com:80>
 ServerAdmin admin@example.com
 DocumentRoot "/srv/www/sites/example.com/"
ServerName example.com
 ServerAlias www.example.com
ErrorLog "logs/example.com_error.log"
 CustomLog "logs/example.com_access.log" combined

ProxyPass / http://192.168.200.20/
 ProxyPassReverse / http://192.168.200.20/

RewriteEngine On # if maintenance.html exists RewriteCond
%{DOCUMENT_ROOT}/maintenance.html -f # and the request is not for
maintenance.html RewriteCond %{REQUEST_URI} !^/maintenance\.html$ #
redirect to maintenance.html RewriteRule ^(.*)$ /maintenance.html [L]
</VirtualHost>


> I'd also like it to happen where if Physical Server 4's Apache instance is
> down for maintenance (backups, year end processing, etc.), that the Proxy
> Server (Physical Server 1) can display a message saying that the site is
> down for maintenance.  I'm presuming this would be handled via the
> 'ErrorDocument 503' that you mentioned in your last e-mail, yes?
>
The 503 is best for unplanned outages since it does not show until the
attempt to connect to the backend server times out.


> I also presume that the DNS entries for www.mycompany.com,
> anothersite.mycompany.com, and thirdsite.mycompany.com would all have the
> same IP address and then the Proxy Server (Physical Server 1) would play
> 'traffic cop' and then forward the necessary traffic to the proper host
> behind the scenes.
>
Correct. And as in my example, I would put the IP addresses of the internal
servers so they don't have to do DNS lookups.


> Also if anyone wants to point me towards somewhere where I can learn more
> about this (web site, books, etc.) so I'm not cluttering up this mailing
> list with newbie questions, please feel free to point me that way.

This list is a perfectly reasonable place.

- Y