Hi,
 
After 2 days trying to resolve my problem, I am close to think about a
bug in mod_perl used with mod_proxy.
 
let summarize my problem in case someone could help me :
 
CLIENT ------> Reverse-Proxy -------> Application Servers
 
Reverse-Proxy is : Linux, Apache 2.0.59, mod_perl 2.0.3
Application Servers are : 
    - Windows 2003, IIS 6, .Net 2.0
    - Linux, Apache 2.0.59, php 5.2.0
 
Configured as Reverse Proxy only, Apache is serving correctly the
request to the Application Servers
httpd.conf :
------------------------------------------------------------------------
------
<VirtualHost *:80>
 ServerAdmin [EMAIL PROTECTED]
 ServerName www.domain.tld
 ProxyPreserveHost On
 ProxyPass / http://10.0.0.100/
 ProxyPassReverse / http://10.0.0.100/

 CustomLog /www/doma.tld/logs/access_log combined
 ErrorLog /www/doma.tld/logs/error_log
</VirtualHost>
------------------------------------------------------------------------
------
 
I wanted to use the PerlAuthenHandler and PerlAuthzHandler in order to
protect some areas of my Application servers directly at the reverse
proxy level
 
Perl module : AuthConst.pm
------------------------------------------------------------------------
------
#
# AuthConst.pm
#
package Apache2::AuthConst;
 
use strict;
 
use Apache2::Const -compile => qw(HTTP_UNAUTHORIZED FORBIDDEN DECLINED
OK);
 
1;
__END__
------------------------------------------------------------------------
------
 
httpd.conf :
------------------------------------------------------------------------
------
PerlModule Apache2::AuthConst
 
<VirtualHost *:80>
 ServerAdmin [EMAIL PROTECTED]
 ServerName www.domain.tld <http://www.domain.tld/> 
 ProxyPreserveHost On
 ProxyPass / http://10.0.0.100/
 ProxyPassReverse / http://10.0.0.100/

 CustomLog /www/doma.tld/logs/access_log combined
 ErrorLog /www/doma.tld/logs/error_log
 
 <LocationMatch /(?i)protected/>
   PerlAuthenHandler Apache2::Const::OK
   Require foobar
 </LocationMatch>
 
</VirtualHost>
------------------------------------------------------------------------
------
 
Normaly, Apache should allow connection to the remote application server
for all request without calling the PerlHandler if the path is not part
of /protected.
But when a page in http://www.domain.tld/protected/ is called, the
PerlAuthenHandler is called in order to check the Authentication.
 
For now, my module just returns standard Apache2::Const::OK value, which
result in allowing Apache to proxy the request to the remote application
server.
This is correctly performed (anybody can test to confirm or not) ...
 
the problem comes when a protected page is called with a querystring :
http://www.domain.tld/protected/test.php?test=true or
http://www.domain.tld/protected/test.aspx?test=true
the remote application server receives the request, but with no
querystring !!! it is removed after the call to the PerlAuthenHandler.
 
If I create some more "complex" handler to log the request (URI +
QueryString) ... I can see the querystring in the Handler, but not in
the remote application server.
 
Just by deactivating the call to the Handler (by commenting out the
Require foobar line) ... the querystring is correctly received by the
remote application server.
 
 
Does anybody already face this problem ???
 
 
 
Best regards
 
Sylvain
 
PS: here is an extract of mp2bug on my installation :
===============================================
 
1. Problem Description:
 
  [DESCRIBE THE PROBLEM HERE] => See my email content :-)
 
2. Used Components and their Configuration:
 
*** mod_perl version 2.000003
 
*** using
/usr/lib/perl5/site_perl/5.8.8/i486-linux/Apache2/BuildConfig.pm
 
*** Makefile.PL options:
  MP_APR_LIB     => aprext
  MP_APXS        => /usr/local/apache-2.0/bin/apxs
  MP_COMPAT_1X   => 1
  MP_GENERATE_XS => 1
  MP_LIBNAME     => mod_perl
  MP_USE_DSO     => 1
 

*** The httpd binary was not found
 

*** (apr|apu)-config linking info
 
 -L/usr/local/apache-2.0//lib -laprutil-0 -lexpat
 -L/usr/local/apache-2.0//lib -lapr-0 -lrt -lm -lcrypt -lnsl  -lpthread
-ldl
 
 
 
*** /usr/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
  Platform:
    osname=linux, osvers=2.4.33.3, archname=i486-linux
    uname='linux tree 2.4.33.3 #1 fri sep 1 01:48:52 cdt 2006 i686
athlon-4 i386 gnulinux '
    config_args='-de -Dprefix=/usr -Dcccdlflags=-fPIC
-Dinstallprefix=/usr -Doptimize=-O2 -march=i486 -mtune=i686
-Dinc_version_list=5.8.7 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0
-Darchname=i486-linux'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe
-Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
    optimize='-O2 -march=i486 -mtune=i686',
    cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement
-I/usr/local/include'
    ccversion='', gccversion='3.4.6', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.3.6.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.3.6'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
 

Characteristics of this binary (from libperl):
  Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO
  Built under linux
  Compiled at Sep  1 2006 23:31:27
  %ENV:
    PERL_LWP_USE_HTTP_10="1"
  @INC:
    /usr/lib/perl5/5.8.8/i486-linux
    /usr/lib/perl5/5.8.8
    /usr/lib/perl5/site_perl/5.8.8/i486-linux
    /usr/lib/perl5/site_perl/5.8.8
    /usr/lib/perl5/site_perl
    .
 
*** Packages of interest status:
 
Apache2            : -
Apache2::Request   : 2.08
CGI                : 3.25
ExtUtils::MakeMaker: 6.31
LWP                : 5.805
mod_perl           : -
mod_perl2          : 2.000003
 

3. This is the core dump trace: (if you get a core dump):
 
  [CORE TRACE COMES HERE]
 
This report was generated by /usr/bin/mp2bug on Tue Jan  9 23:56:09 2007
GMT.

 
 
 
 

 

Reply via email to