ModPerl handler

This is a multi-part message in MIME format.
--------------060206050801000802060902
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi,
I'm writing an handler to execute with mod_perl.
I want to associate an handler of type PerlPostConfigHandler.
I write this code (filename=StartupLog.pm):

#file:Apache/StartupLog.pm
package Apache::StartupLog;

use strict;
use warnings;
use Apache();

use Apache::Constants qw(OK);

sub funzione {

my $r=shift;
$r->content_type('text/html');
my $remote_ip = $r->connection->remote_ip;
$r->print("
<html><head><title>mod_perl test</title></head>",
"<body><h1>hello ", $remote_ip , "<h1>",
"</body></html>");

return OK;
}
1;

My questions are:
1. I don't know what is the code I must put in httpd.conf file.
2. Where must I put the file StartupLog.pm in the filesystem?

Can someone help me?

Thanks


--------------060206050801000802060902
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body alink="#ee0000" bgcolor="#ffffff" text="#000000" vlink="#551a8b"
link="#0000ee">
Hi,<br>
I'm writing an handler to execute with mod_perl.<br>
I want to associate an handler of type PerlPostConfigHandler.<br>
I write this code (filename=<font color="#3366ff">StartupLog.pm</font>):<br>
<br>
<font color="#3366ff">#<a class="moz-txt-link-freetext" href="file:Apache/StartupLog.pm">file:Apache/StartupLog.pm</a></font><br>
  package Apache::StartupLog;<br>
  <br>
  use strict;<br>
  use warnings;<br>
  use Apache();    <br>
  <br>
  use Apache::Constants qw(OK); <br>
     <br>
  sub funzione {<br>
      <br>
    my $r=shift;<br>
    $r->content_type('text/html'); <br>
    my $remote_ip = $r->connection->remote_ip;<br>
    $r->print("<br>
        <html><head><title>mod_perl
test</title></head>",<br>
        "<body><h1>hello ", $remote_ip , "<h1>",<br>
        "</body></html>");    <br>
      <br>
         return OK;<br>
  } <br>
  1;<br>
<br>
My questions are:<br>
1. I don't know what is the code I must put in httpd.conf file.<br>
2. Where must I put the file <font color="#000000">StartupLog.pm in
the filesystem?<br>
<br>
</font>Can someone help me?<br>
<br>
Thanks<br>
<br>
</body>
</html>

--------------060206050801000802060902--
Marco [ Mi, 18 Mai 2011 21:43 ] [ ID #2059642 ]

Re: ModPerl handler

--_000_C9F972142EBAjmccarreakamaicom_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

http://perl.apache.org/docs/2.0/user/intro/start_fast.html

There are a wealth of good (maybe even great) docs here that explain the re=
quest life cycle, configuration =85 pretty much everything you need to know=
..
Happy reading!

From: marco <marcodisano [at] gmail.com<mailto:marcodisano [at] gmail.com>>
Date: Wed, 18 May 2011 14:43:57 -0500
To: Mod_perl users <modperl [at] perl.apache.org<mailto:modperl [at] perl.apache.org>=
>
Subject: ModPerl handler

Hi,
I'm writing an handler to execute with mod_perl.
I want to associate an handler of type PerlPostConfigHandler.
I write this code (filename=3DStartupLog.pm):

#file:Apache/StartupLog.pm
package Apache::StartupLog;

use strict;
use warnings;
use Apache();

use Apache::Constants qw(OK);

sub funzione {

my $r=3Dshift;
$r->content_type('text/html');
my $remote_ip =3D $r->connection->remote_ip;
$r->print("
<html><head><title>mod_perl test</title></head>",
"<body><h1>hello ", $remote_ip , "<h1>",
"</body></html>");

return OK;
}
1;

My questions are:
1. I don't know what is the code I must put in httpd.conf file.
2. Where must I put the file StartupLog.pm in the filesystem?

Can someone help me?

Thanks


--_000_C9F972142EBAjmccarreakamaicom_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<html><head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
252"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space;=
-webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14p=
x; font-family: Calibri, sans-serif; "><div><a href=3D"http://perl.apache.o=
rg/docs/2.0/user/intro/start_fast.html">http://perl.apache.o rg/docs/2.0/use=
r/intro/start_fast.html</a></div><div><br></div><div>There are a wealth of =
good (maybe even great) docs here that explain the request life cycle, conf=
iguration =85 pretty much everything you need to know.</div><div>Happy read=
ing!</div><div><br></div><span id=3D"OLK_SRC_BODY_SECTION"><div style=3D"fo=
nt-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOT=
TOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LE=
FT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: m=
edium none; PADDING-TOP: 3pt"><span style=3D"font-weight:bold">From: </span=
> marco <<a href=3D"mailto:marcodisano [at] gmail.com">marcodisano [at] gmail.com<=
/a>><br><span style=3D"font-weight:bold">Date: </span> Wed, 18 May 2011 =
14:43:57 -0500<br><span style=3D"font-weight:bold">To: </span> Mod_perl use=
rs <<a href=3D"mailto:modperl [at] perl.apache.org">modperl [at] perl.apache.org</=
a>><br><span style=3D"font-weight:bold">Subject: </span> ModPerl handler=
<br></div><div><br></div><div>




<div alink=3D"#ee0000" bgcolor=3D"#ffffff" text=3D"#000000" vlink=3D"#551=
a8b" link=3D"#0000ee">
Hi,<br>
I'm writing an handler to execute with mod_perl.<br>
I want to associate an handler of type PerlPostConfigHandler.<br>
I write this code (filename=3D<font color=3D"#3366ff">StartupLog.pm</fo=
nt>):<br>
<br>
<font color=3D"#3366ff">#<a class=3D"moz-txt-link-freetext" href=3D"fil=
e:Apache/StartupLog.pm">file:Apache/StartupLog.pm</a></font><br>
  package Apache::StartupLog;<br>
  <br>
  use strict;<br>
  use warnings;<br>
  use Apache();    <br>
  <br>
  use Apache::Constants qw(OK); <br>
     <br>
  sub funzione {<br>
      <br>
    my $r=3Dshift;<br>
    $r->content_type('text/html'); <br>
    my $remote_ip =3D $r->connection->remote_ip;<b=
r>     $r->print("<br>
        <html><head><title=
>mod_perl
test</title></head>",<br>
        "<body><h1>hello=
", $remote_ip , "<h1>",<br>
        "</body></html>&=
quot;);    <br>
      <br>
         return OK;<br>
  } <br>
  1;<br>
<br>
My questions are:<br>
1. I don't know what is the code I must put in httpd.conf file.<br>
2. Where must I put the file <font color=3D"#000000">StartupLog.pm in
the filesystem?<br>
<br>
</font>Can someone help me?<br>
<br>
Thanks<br>
<br>
</div></div></span></body></html>

--_000_C9F972142EBAjmccarreakamaicom_--
Jeff McCarrell [ Mi, 18 Mai 2011 21:56 ] [ ID #2059643 ]
Webserver » gmane.comp.apache.mod-perl » ModPerl handler

Vorheriges Thema: Ubuntu and mod_perl
Nächstes Thema: Install mod perl