John Chiu wrote:
Thanks in advance. I've tried all the archives and google'd but I have not found anything that would help.



I'm running RH 8.0, httpd-2.0.40-11.5 and mod_perl-1.99_05-3 from the RedHat distribution. I'm trying to create a small proxy module that will check a non-proxy request and depending on "stuff" dynamically transform it into a proxy request using mod_proxy.

1.99_05 is a way too old. Lots of bugs were fixed since that release. Upgrade to at least 1.99_09 or better the current cvs. 1.99_10 will be released as soon as perl-5.8.1 is released.


I'm following the example in Chapter 7 (page 370) of the "Writing Apache Modules with Perl and C". I know that the book is based on the older apache 1.3 server and associated mod_perl. However, I have not found anything in my readings to indicate that this would not work any more.

my $r =3D shift;
[... code snipped ...]

BTW, you mailer has mangled the source code, s/=/=3D/

Additionally, a 502 Bad Gateway error was encountered while trying to use an ErrorDocument to handle the request.



The apache error log indicates (with some debugging) that it is looping on the "GET" of goodbye.html. Additional debuging indicates that $r->proxyreq is always 0, so it's looping. My questions are:



1. Did sometime change in apache 2 or mod_perl 2 so that you cannot

set proxyreq anymore: ie. $r->proxyreq(1).

2. How do you set proxyreq if $r->proxyreq(1) is not the correct

method?

3. Is the logic wrong in this proxy example?

How can we possible know what the problem is if you don't show the relevant configuration section? Most likely you have a broken configuration and should advise first the mod_proxy documentation.
http://httpd.apache.org/docs-2.0/mod/mod_proxy.html


To make sure that the problem is not in mod_perl, I've added a new modules/proxy test to the mp2 test suite, based on that example from the eagle book. Try it and if you succeed to break it, then we will fix it. You will need to retrieve the cvs version in order to get it.
http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution
(note: I have just committed the test, so if you use the snapshot, which is updated every 6 hours, it may not be there, so use the normal cvs checkout)


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Reply via email to