in reply to Re^3: Getting the client IP in Apache, version 2.4
in thread Getting the client IP in Apache, version 2.4

How did you get that to work?!

Can't locate object method "client_addr" via package "Apache2::Connection"

Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 mod_apreq2-20090110/2.8.0 mod_perl/2.0.10 Perl/v5.26.1

  • Comment on Re^4: Getting the client IP in Apache, version 2.4

Replies are listed 'Best First'.
Re^5: Getting the client IP in Apache, version 2.4
by haukex (Archbishop) on Nov 27, 2019 at 13:58 UTC
    How did you get that to work?!
    Can't locate object method "client_addr" via package "Apache2::Connection"
    Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 mod_apreq2-20090110/2.8.0 mod_perl/2.0.10 Perl/v5.26.1

    It's been a very long time since I last worked with mod_perl, but what is strange here is that I can't find a reference to ->client_addr neither here nor here. Have you tried ->remote_ip instead?

      Yes, that is the first thing I tried. But none of the remote_* or client_* methods seem to be defined for Apache2::Connection. I could get useragent_ip, but I'm trying to use this to blacklist malicious users, and I suspect an attacker could spoof that easily.

        But none of the remote_* or client_* methods seem to be defined for Apache2::Connection.

        That sounds quite strange to me - but as I said, I'm not an expert on mod_perl anymore, maybe another Monk will know more if you post a new question. What version does Apache2::Connection report? (i.e. $Apache2::Connection::VERSION)

        Minor edits shortly after posting.