yeah, I got that.. its pretty much the same as Perl regex.

However.. I am not sure now that the regex is the issue...

After hours and hours of googling on the issue I believe its a
deficiency in apache.. one that mandrakes apache with virt named hosting
setup brings to the fore.

The issue is more or less specific to me, virtual named hosting
with proxied mod perl using proxy redirects.

To give you an idea, both of these work:

http://mydomain.com:8200/perl/dl.pl?login=yes

http://mydomain.com/perl/dl.pl/?login=yes

(the second one works (notice the /?), but not as modperl for some reason it
seems to be executing as cgi or something. and rewriting the regex to add
the / into the proxy address has the same effect (as slow as cgi perl).
(I know its not using mod perl because its the HTTP process that shows up in
'top' when it is run, whereas http-perl shows up when run the first way.)

As before, this:
http://mydomain.com/perl/dl.pl?login=yes

results in this:
[Wed Jun 11 18:40:11 2003] [error] [client 192.168.0.6] File does not exist:
proxy:http://127.0.0.1:8200/perl/dl.pl?login=yes

Appearing in the log, and a page not found error appearing on the browser.

So in essense, mod_rewrite doing the proxy doesn't appear to pass the params
on.. instead it seem to be implying they are part of the filename..

Go figure, the two things I wanted to do with apache/Perl, are both broken
with named virtual hosting.
(mod_perl SSI and this.)

Does anyone know a method by which I might achieve the same result? (I can't
use port 8200 links in the pages because we have already experianced
problems with some routers not allowing that.)


regards

Franki




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Steven Broos
Sent: Wednesday, 11 June 2003 6:08 PM
To: [EMAIL PROTECTED]
Subject: Re: [newbie] apache rewrite regex


. means every character
* means zero, one or more instances of the previous character.
^ means beginning of the line (or negation in some situations)
$ means end of line
The part of the regexp between the brackets will be returned as $1

So the first regexp ^(.*\/perl\/.*)$  says:
- If a line starts (^) with zero, one or more instances of any character
- followed by  /perl/ (the slashes are backslashed because it are
special characters)
- followed by zero, one or more instances of any character

result ==> the whole line without any end-of-line characters, if it
contains /perl/, Nothing if it doesn't contain /perl/

So a wild guess for the string you want to write:

^\/perl\/dl.pl(\/.*)$   http://127.0.0.1:8200/perl/dl.pl$1
But I guess the regexp you wrote first will work to !

Steven


On Wed, 2003-06-11 at 09:05, Frankie wrote:
> Hi guys
>
>
> I am hoping that on this list is a regex/apache guru...
> Currently, I have mdk9.0 running mod_perl/apache via virtual named hosts..
>
> works great.
>
> I can run mod_perl scripts in either of the following methods:
>
> http://mydomain.com/perl/script.pl
> or
> http://mydomain.com:8200/perl/script.pl
>
> so the basic proxying works..
>
> However only the latter URL works when passed params.. like so:
> http://mydomain.com:8200/perl/script.pl?id=something&function=stuff
> (that one works)
>
> This one doesn't:
> http://mydomain.com/perl/script.pl?id=something&function=stuff
>
> when I try that I always get the message that script.pl can't be found.
>
> Since its an internal proxy, I can't see what the regex has grabbed.
> This is the regex in question in the vhosts file:
>
> RewriteRule ^(.*\/perl\/.*)$  http://127.0.0.1:8200$1 [P]
>
> I tried adding this one too in an effort to be more specific.. but it
> didn't work either:
>
> RewriteRule /perl\/dl.pl/(.*)  http://127.0.0.1:8200/perl/dl.pl$1 [P]
>
> What I don't understand is this:
> .*
>
> In my mind means '0' or more of 'anything'
>
> so why is it not catching params??
>
> Can anyone point me in the right direction here?
>
>
> regards
>
>
> Franki
>
>
>
>
> ______________________________________________________________________
>
> Want to buy your Pack or Services from MandrakeSoft?
> Go to http://www.mandrakestore.com




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to