Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

ModPerl handler

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


marcodisano at gmail

May 18, 2011, 12:43 PM

Post #1 of 2 (479 views)
Permalink
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=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


jmccarre at akamai

May 18, 2011, 12:56 PM

Post #2 of 2 (456 views)
Permalink
Re: ModPerl handler [In reply to]

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 request life cycle, configuration pretty much everything you need to know.
Happy reading!

From: marco <marcodisano [at] gmail<mailto:marcodisano [at] gmail>>
Date: Wed, 18 May 2011 14:43:57 -0500
To: Mod_perl users <modperl [at] perl<mailto:modperl [at] perl>>
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=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

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.