wrote:
> Hello
>
> I am developing a simple mp2 application.
> I looked for the installation for mp2 utils, and found this two:
>
> libapache2-mod-perl2
>
> libapache2-mod-apreq2
>
>
> what're their relations? Should I install both, or only the first one?
>
>
> Thanks.
>
--0000000000002e737d05b716fd1b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
I am a newbie to mp development stack.
After=C2=A0one =
day of work, I have made a simple handler, which returns the client's a=
ddress and its PTR record.
The demo:
v>The code shown below:common-ligatures;color:rgb(0,0,0);font-family:Menlo;font-size:11px">
pan>
lor:rgb(0,0,0);font-family:Menlo;font-size:11px">package MyHostname;=
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">use strict;
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">use Net::DNS;
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">use Apache2::RequestRec ();an>
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">use Apache2::RequestIO ();n>
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">use Apache2::Connection ();an>
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">use APR::Table ();
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">use Apache2::Const -compile =3D=
> qw(OK FORBIDDEN);
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">sub handler {
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 my $r =3D shift;
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 my $ip =3D $r->headers_in->{'CF=
-Connecting-IP'} ||=C2=A0 <=
/span>$r->connection->client_ip;
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 my $host =3D dns_query($ip) || "&quo=
t;;
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 $r->content_type('text/plain; char=
set=3Dutf-8');
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 $r->print("Your IP: $ip, Hostname=
: $host");
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 return Apache2::Const::OK;
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">}
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">sub dns_query {
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 my $ip =3D shift;
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 my $resolver =3D Net::DNS::Resolver->n=
ew();
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 my $reply =3D $resolver->query($ip, =
39;PTR');
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 if ($reply) {
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 =C2=A0 =C2=A0 for my $rr ($reply->answ=
er) {
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return $rr-&g=
t;rdstring;=C2=A0 # we n=
eed only one
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 }
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">erted-space">=C2=A0 =C2=A0 return;
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">}
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0);min-height:13px">il-s1" style=3D"font-variant-ligatures:no-common-ligatures">
variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:no=
rmal;font-family:Menlo;color:rgb(0,0,0)">font-variant-ligatures:no-common-ligatures">1;
p1" style=3D"margin:0px;font-variant-numeric:normal;font-variant-east-asian=
:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:M=
enlo;color:rgb(0,0,0)">ures:no-common-ligatures">
gin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-str=
etch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0=
,0,0)">igatures">
iant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font=
-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">le=3D"font-variant-ligatures:no-common-ligatures">Can anyone give your revi=
ew? Thanks in advance.
font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:nor=
mal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><=
span style=3D"font-variant-ligatures:no-common-ligatures">
class=3D"gmail-p1" style=3D"margin:0px;font-variant-numeric:normal;font-va=
riant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:norm=
al;font-family:Menlo;color:rgb(0,0,0)">s:no-common-ligatures">Matthias
rgin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-st=
retch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(=
0,0,0)">
an>