I've installed the mod_perl.c module on an apache 1.3.6 rh6.2 box. I added the Location tag in my httpd.conf file.
From the looks of eveything mod_perl is installed and in the game. My httpd.conf file has the following.
# If the perl module is installed, this will be enabled.
<IfModule mod_perl.c>
Alias /perl/ /home/httpd/perl/
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>
</IfModule>
I duplicated the following script in
order to test the mod_perl for speed.
#!/usr/bin/perl -w
$|=1;
use strict;
use LWP::Simple;
use Time::HiRes;
print "Content-type:text/html\n\n";
print "\n\n<pre>";
print Time::HiRes::time()."\n";
my $cd;my $z;
my $st = Time::HiRes::time();
for($z=0; $z < 10;$z++){
my $ast = Time::HiRes::time();
my $get = get "http://www.perl.to/index.cgi?a=".$z;
my $aed = Time::HiRes::time();
print "$z(".($aed-$ast).")\n";
}
print "$cd\n";
my $ed = Time::HiRes::time();
print "took=".($ed-$st)."</pre>";
One copy of the script above went in my mod_perl
folder (/home/httpd/perl/). It ran from a web browser.
mod_perl ON
The other went to a Virtual Domain folder on the same server. It can be seen at.
mod_perl OFF
Both scripts work. My error_logs are quiet when i test them. My question is, why isn't my mod_perl faster?
Does anyone know of a way to verify, within a perl script, the status of mod_perl? I notice that the Content-type header is visible in the mod_perl test from the browser. Doesn't that tell me it's working?
- Advice encouraged
jtrue
P.S.
perl -v = version 5.005_03
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.