New to mod_perl

New to mod_perl

am 19.05.2008 17:18:41 von Roy Kartadinata

This is a multi-part message in MIME format.

------_=_NextPart_001_01C8B9C3.9F4BE68E
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello all,

=20

I'm relatively new to mod_perl and need to know from all mod_perl
experts here if mod_perl can pass a variable back to apache, or maybe
any of you have a better solution for it.

=20

I'm setting up a proxy using Apache 2.2.8 with mod_proxy and I need to
add a custom request header with information that is currently stored in
our MySQL server. I was thinking of using Apache to get user's IP
address and pass it to mod_perl where mod_perl script will query the
database based on that IP address, but I'm not sure how to have mod_perl
send the result back to Apache.=20

=20

Just a note, I've been testing using mod_header to add a custom request
header and it has been working. I've also tested using
Apache2::Filter::HTTPHeadersFixup and for some reason it works fine if
the destination website doesn't use any kind of cookies.=20

=20

Any ideas?

=20

=20

=20

Thanks,

=20

=20


------_=_NextPart_001_01C8B9C3.9F4BE68E
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">


charset=3Dus-ascii">









style=3D'font-size:10.0pt;
font-family:Arial'>Hello all,



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>I’m relatively new to mod_perl and need to know =
from
all mod_perl experts here if mod_perl can pass a variable back to =
apache, or
maybe any of you have a better solution for =
it.



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>I’m setting up a proxy using Apache 2.2.8 with
mod_proxy and I need to add a custom request header with information =
that is
currently stored in our MySQL server. I was thinking of using Apache to =
get
user’s IP address and pass it to mod_perl where mod_perl script =
will
query the database based on that IP address, but I’m not sure how =
to have
mod_perl send the result back to Apache.



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>Just a note, I’ve been testing using mod_header =
to add
a custom request header and it has been working. I’ve also tested =
using
Apache2::Filter::HTTPHeadersFixup and for some reason it works fine if =
the
destination website doesn’t use any kind of cookies. =



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>Any ideas?



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>Thanks,



style=3D'font-size:
12.0pt'>  



style=3D'font-size:
12.0pt'> 









------_=_NextPart_001_01C8B9C3.9F4BE68E--

Re: New to mod_perl

am 20.05.2008 20:23:56 von Perrin Harkins

Hi Roy,

> I'm setting up a proxy using Apache 2.2.8 with mod_proxy and I need to add a
> custom request header with information that is currently stored in our MySQL
> server. I was thinking of using Apache to get user's IP address and pass it
> to mod_perl where mod_perl script will query the database based on that IP
> address, but I'm not sure how to have mod_perl send the result back to
> Apache.

I think you're not getting responses to this because no one is sure
what you're trying to do. Are you saying that you're building a proxy
server with mod_proxy and mod_perl in it and you want to add something
to the requests that you proxy before sending them on to the real
server? Have you tried writing a mod_perl fixup handler?

> Just a note, I've been testing using mod_header to add a custom request
> header and it has been working. I've also tested using
> Apache2::Filter::HTTPHeadersFixup and for some reason it works fine if the
> destination website doesn't use any kind of cookies.

Ok, are you saying that it doesn't work when there are cookies? How
does it fail? What happens?

- Perrin