Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Getting the client IP in Apache, version 2.4

by Corion (Patriarch)
on Jan 04, 2017 at 20:07 UTC ( [id://1178956]=note: print w/replies, xml ) Need Help??


in reply to Getting the client IP in Apache, version 2.4

It's not get_ip but ip_get, at least according to APR::SockAddr.

Replies are listed 'Best First'.
Re^2: Getting the client IP in Apache, version 2.4
by rjschwei (Novice) on Jan 05, 2017 at 19:27 UTC
    Yeah obviously I turned things around in my original message. However, the problem description is correct:

    Can't locate object method "ip_get" via package "APR::SockAddr"

    So with Apache 2.4 the documentation and implementation are out of kilter.
      OK, answering my own question.

      use APR::SockAddr;

      is obviously required, after which

      $r->connection()->client_addr()->ip_get;

      Works as expected.

      Sorry for the noise

        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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1178956]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-03-28 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found