perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JW <>
Subject Re: Question about Apache 2.4 and libapreq2 (Apache2::Request)
Date Fri, 10 Mar 2017 03:53:27 GMT
Back in January I was planning on moving to Apache 2.4+mod_perl+libapreq2 
from Apache 2.2+mod_perl+libapreq2. I'd asked if anyone had problems doing a similar
move -- the answer was no. Thank you again to everyone who replied my earlier post.  

It's been over a month since moving to Apache 2.4. It was fairly straightforward and requiredlittle
code to be updated, most of it Apache config. Everything runs as it did before the update
and I've 
had no problems. The one function that didn't 'work' is described below. 

This mod_perl server is behind a proxy on the same machine. Under Apache 2.2, $r->remote_ip()

returned and not the user's actual IP.  So, a PerlPostReadRequestHandler extracted
the user's 
IP address from the X-Forwarded-For header and set it with $r->remote_ip( $ip ).

In Apache 2.4 (and mod_perl now) $c->remote_ip is split into $r->useragent_ip and $c->client_ip: 
But, $r->useragent_ip (wrongly) gives me Perhaps this'll be fixed at some point
(unlessI'm doing something wrong). So, for now, as above, the IP is extracted from X-Forwarded-For

and set with $r->useragent_ip( $ip ). 

I was asked by one of the earlier responders to share my experience with the move to Apache
2.4,in case there were others in the same boat. So, if there are, jump right in and good luck!

View raw message