overworked has asked for the wisdom of the Perl Monks concerning the following question:

I'm relative new to perl and I need to create a Mod_perl2 Apache2 Module of my own, but one of the key items is for me to capture the remote IP and the URL that they are trying to access. I have tried a number of ways but all have failed, any advice or references would be greatly appreciated. Cheers Overworked

Replies are listed 'Best First'.
Re: Mod_perl2 Apache Module
by tachyon-II (Chaplain) on Apr 24, 2008 at 04:03 UTC

    What ways have you tried? I'm sure you know these two pieces of info are in the standard apache.log where you can parse them out easily. If you mean in real time within mod_perl to do something with:

    use Apache2::RequestRec (); use Apache2::Connection (); sub handler { my $r = shift; # the path portion of the URI my $uri = $r->uri(); # the connection object my $c = $r->connection(); # from which we get my $remote_ip = $c->remote_ip(); # whatever }
      Hello, I would like to thank all of you for the quick responses, it would seem I was on the correct path but was doing something very stupid but tachyon-II showed me my real basic error through the example that was posted. Thank you all for the help Cheers overworked
Re: Mod_perl2 Apache Module
by ww (Archbishop) on Apr 24, 2008 at 02:03 UTC
    overworked: you're forcing us to over-work our imagination.

    What references have you sought out? Have you studied any modules intended for/working on the system you're targeting? Have you tried Search and Super Search using some of the terms in your post?

    And, who is this "they" who are "trying to access" what?

Re: Mod_perl2 Apache Module
by TOD (Friar) on Apr 24, 2008 at 04:02 UTC