ProxyPass within LocationMatch not working

This is a discussion on ProxyPass within LocationMatch not working within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi! I am running two apache installations on port 80 (with php4) and 81 (with php5). Now I'd like ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-30-2004
Andreas Hammerschmidt
 
Posts: n/a
Default ProxyPass within LocationMatch not working

Hi!

I am running two apache installations on port 80 (with php4) and 81 (with
php5).

Now I'd like to pass all files ending with .php5 from port-80-apache to
port-81-apache

I used the following configuration, but it didn't work:

<LocationMatch ".*\.php5$">
ProxyPass http://localhost:81/
</LocationMatch>

If I use "Deny from all" the files are locked. So the regular expression is
correct.
If I use <Location /php5> the request is forwarded. So the ProxyPass
expression is correct.

Does anyone know why this isn't working and what can I do to get it running?

thx,
Andreas


  #2 (permalink)  
Old 10-02-2004
Joachim Ring
 
Posts: n/a
Default Re: ProxyPass within LocationMatch not working

"Andreas Hammerschmidt" <Andreas.Hammerschmidt@gmx.net> wrote in message news:<415c87c6$1@e-post.inode.at>...
> Hi!
>
> I am running two apache installations on port 80 (with php4) and 81 (with
> php5).
>
> Now I'd like to pass all files ending with .php5 from port-80-apache to
> port-81-apache
>
> I used the following configuration, but it didn't work:
>
> <LocationMatch ".*\.php5$">
> ProxyPass http://localhost:81/
> </LocationMatch>
>
> If I use "Deny from all" the files are locked. So the regular expression is
> correct.
> If I use <Location /php5> the request is forwarded. So the ProxyPass
> expression is correct.
>
> Does anyone know why this isn't working and what can I do to get it running?


don't know, but let me get the swiss pocket knife:

RewriteEngine On
RewriteRule (.*\.php5)$ http://localhost:81/$1 [P,L]

Joachim

PS: the docs are specifically talking abut a special case of using
ProxyPass inside a <Location> header - maybe they meant just that...
  #3 (permalink)  
Old 10-02-2004
Andreas Hammerschmidt
 
Posts: n/a
Default Re: ProxyPass within LocationMatch not working (.php5 proxy redirection)

"Joachim Ring" <jring@web.de> schrieb im Newsbeitrag
news:3ae246c1.0410011616.7143c0f1@posting.google.c om...
> "Andreas Hammerschmidt" <Andreas.Hammerschmidt@gmx.net> wrote in message
> news:<415c87c6$1@e-post.inode.at>...
>> Hi!
>>
>> I am running two apache installations on port 80 (with php4) and 81 (with
>> php5).
>> [...]
>> Does anyone know why this isn't working and what can I do to get it
>> running?

>
> don't know, but let me get the swiss pocket knife:
>
> RewriteEngine On
> RewriteRule (.*\.php5)$ http://localhost:81/$1 [P,L]
>
> Joachim
>
> PS: the docs are specifically talking abut a special case of using
> ProxyPass inside a <Location> header - maybe they meant just that...


It's working now. Many thanks to you!

I had to change it a bit to work correctly, because your version generates
"GET //index.php5 HTTP/1.1" instead of "GET /index.php5 HTTP/1.1". So you
have to remove the / before $1.

My finally working version:
RewriteEngine On
ProxyPreserveHost On
RewriteRule (.*\.php5)$ http://localhost:81$1 [P,L]

All .php5 requests are now forwarded to the port-81-apache and the original
Hostname is preserved, so links generated by the PHP script link back to the
port-80-apache.

thx,
Andreas


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:55 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0