You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ruiyuan Jiang <Ru...@liz.com> on 2010/04/27 21:54:24 UTC

[users@httpd] RE: Wield problem with a reverse proxy server

Hi, all

I posted below email but got no answer. Now I found that my Apache 2.2.15 stopped working. It behaves the same way as Apache 2.2.14.
As a test, I switched the order on Apache 2.2.15 for these two virtual host statements:

<VirtualHost 10.10.10.10:80>
....
</VitualHost>
....

<VirtualHost 10.10.10.10:80>
	ServerName	www.survey.juicycouture.com
	Redirect	/	http://survey.juicycouture.com/tellus
</VirtualHost>

<VirtualHost 10.10.10.10:80>
	ServerName	www.survey.juicycouture.com
	Redirect	/tellus	http://survey.juicycouture.com/tellus
</VirtualHost>

It seems the first virtual host working but the second virtual host for the site no longer working. Sounds to me that for the same site for redirect, Apache takes the first virtual host.

The requirement for the site is if the remote user uses either the URL http://www.survey.juicycouture.com or http://www.survey.juicycouture.com/tellus, Apache needs to redirect the traffic to the remotely hosted site http://survey.juicycouture.com/tellus from my reverse proxy server. 
I thought about rewrite engine but not that good about it. Can anyone help to figure out the best way? Thanks.

Ryan




-----Original Message-----
From: Ruiyuan Jiang [mailto:Ruiyuan_Jiang@liz.com] 
Sent: Thursday, April 22, 2010 5:41 PM
To: users@httpd.apache.org
Subject: [users@httpd] Wield problem with a reverse proxy server

Hi, all

I have two reverse proxy servers, one is v2.2.15 (mpm=worker) and the other is v2.2.14 (prefork). They both run on Solaris 10.

Now I have a request to redirct traffic for an additional web site which is outsourced by another party.

What I have done on a reverse proxy (httpd-vhosts.conf) is to append:

<VirtualHost 10.10.10.10:80>
	ServerName	www.survey.juicycouture.com
	Redirect	/tellus	http://survey.juicycouture.com/tellus
</VirtualHost>

<VirtualHost 10.10.10.10:80>
	ServerName	www.survey.juicycouture.com
	Redirect	/	http://survey.juicycouture.com/tellus
</VirtualHost>

On the other reverse proxy server, I did the same:

<VirtualHost 20.20.20.20:80>
	ServerName	www.survey.juicycouture.com
	Redirect	/tellus	http://survey.juicycouture.com/tellus
</VirtualHost>

<VirtualHost 20.20.20.20:80>
	ServerName	www.survey.juicycouture.com
	Redirect	/	http://survey.juicycouture.com/tellus
</VirtualHost>

On the Apache 2.2.15 (ie 10.10.10.10), it works as the way I want. Apache redirect the traffic to the site from URL that I typed in the browser (http://www.survey.juicycouture.com and http://www.survey.juicycouture.com/tellus).

On the Apache 2.2.14 (ie 20.20.20.20), it redirects the URL (http://www.survey.juicycouture.com/tellus) correctly. When I typed http://www.survey.juicycouture.com, it shows me the local document root directory list which has Apache's default index.html file. If I click index.html, it says "It Works!" from Apache and it did redirect the traffic. 
I have put trailing "/" after "tellus",

Redirect	/	http://survey.juicycouture.com/tellus/

But it does not work also. 

What is wrong here? Thanks.

Ryan Jiang



This message (including any attachments) is intended
solely for the specific individual(s) or entity(ies) named
above, and may contain legally privileged and
confidential information. If you are not the intended 
recipient, please notify the sender immediately by 
replying to this message and then delete it.
Any disclosure, copying, or distribution of this message,
or the taking of any action based on it, by other than the
intended recipient, is strictly prohibited.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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




This message (including any attachments) is intended
solely for the specific individual(s) or entity(ies) named
above, and may contain legally privileged and
confidential information. If you are not the intended 
recipient, please notify the sender immediately by 
replying to this message and then delete it.
Any disclosure, copying, or distribution of this message,
or the taking of any action based on it, by other than the
intended recipient, is strictly prohibited.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


RE: [users@httpd] RE: Wield problem with a reverse proxy server

Posted by Ruiyuan Jiang <Ru...@liz.com>.
Hi, Justin

The request is when people type the URL www.survey.juicycouture.com with or without trailing tellus, the client request needs to be redirected to the site survery.juicycouture.com/tellus which is hosted by an outside ISP. I host the URL www.survey.juicycouture.com and www.survey.juicycouture.com/tellus through Apache reverse proxy server. I will test your suggestion. Thanks.

Ryan

-----Original Message-----
From: Justin Pasher [mailto:justinp@newmediagateway.com] 
Sent: Wednesday, April 28, 2010 10:37 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] RE: Wield problem with a reverse proxy server

----- Original Message -----
> From: Ruiyuan Jiang <Ru...@liz.com>
> Date: Tue, 27 Apr 2010 15:54:24 -0400
> Subject: [users@httpd] RE: Wield problem with a reverse proxy server
> To: users@httpd.apache.org <us...@httpd.apache.org>
> 
>
> Hi, all
>
> I posted below email but got no answer. Now I found that my Apache 2.2.15 stopped working. It behaves the same way as Apache 2.2.14.
> As a test, I switched the order on Apache 2.2.15 for these two virtual host statements:
>
> <VirtualHost 10.10.10.10:80>
> ....
> </VitualHost>
> ....
>
> <VirtualHost 10.10.10.10:80>
> 	ServerName	www.survey.juicycouture.com
> 	Redirect	/	http://survey.juicycouture.com/tellus
> </VirtualHost>
>
> <VirtualHost 10.10.10.10:80>
> 	ServerName	www.survey.juicycouture.com
> 	Redirect	/tellus	http://survey.juicycouture.com/tellus
> </VirtualHost>
>   

You have two VirtualHost containers with the exact same settings (same 
IP:port and same ServerName). There's no way for Apache to distinguish 
between the two (it can only do so based upon the IP:port or ServerName).

What are you expecting to happen when someone visits a URL that is NOT 
http://www.survey.juicycouture.com or 
http://www.survey.juicycouture.com/tellus? Where should it go? Depending 
on the answer to this, why not just create one VirtualHost with a simple 
RewriteRule to push all requests to the new URL?

RewriteEngine on
RewriteRule . http://survey.juicycouture.com/tellus

Otherwise, just handle the two special cases

RewriteEngine on
RewriteRule ^/$ http://survey.juicycouture.com/tellus
RewriteRule ^/tellus$ http://survey.juicycouture.com/tellus

-- 
Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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




This message (including any attachments) is intended
solely for the specific individual(s) or entity(ies) named
above, and may contain legally privileged and
confidential information. If you are not the intended 
recipient, please notify the sender immediately by 
replying to this message and then delete it.
Any disclosure, copying, or distribution of this message,
or the taking of any action based on it, by other than the
intended recipient, is strictly prohibited.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


Re: [users@httpd] RE: Wield problem with a reverse proxy server

Posted by Justin Pasher <ju...@newmediagateway.com>.
----- Original Message -----
> From: Ruiyuan Jiang <Ru...@liz.com>
> Date: Tue, 27 Apr 2010 15:54:24 -0400
> Subject: [users@httpd] RE: Wield problem with a reverse proxy server
> To: users@httpd.apache.org <us...@httpd.apache.org>
> 
>
> Hi, all
>
> I posted below email but got no answer. Now I found that my Apache 2.2.15 stopped working. It behaves the same way as Apache 2.2.14.
> As a test, I switched the order on Apache 2.2.15 for these two virtual host statements:
>
> <VirtualHost 10.10.10.10:80>
> ....
> </VitualHost>
> ....
>
> <VirtualHost 10.10.10.10:80>
> 	ServerName	www.survey.juicycouture.com
> 	Redirect	/	http://survey.juicycouture.com/tellus
> </VirtualHost>
>
> <VirtualHost 10.10.10.10:80>
> 	ServerName	www.survey.juicycouture.com
> 	Redirect	/tellus	http://survey.juicycouture.com/tellus
> </VirtualHost>
>   

You have two VirtualHost containers with the exact same settings (same 
IP:port and same ServerName). There's no way for Apache to distinguish 
between the two (it can only do so based upon the IP:port or ServerName).

What are you expecting to happen when someone visits a URL that is NOT 
http://www.survey.juicycouture.com or 
http://www.survey.juicycouture.com/tellus? Where should it go? Depending 
on the answer to this, why not just create one VirtualHost with a simple 
RewriteRule to push all requests to the new URL?

RewriteEngine on
RewriteRule . http://survey.juicycouture.com/tellus

Otherwise, just handle the two special cases

RewriteEngine on
RewriteRule ^/$ http://survey.juicycouture.com/tellus
RewriteRule ^/tellus$ http://survey.juicycouture.com/tellus

-- 
Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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