mod_perl2 User's Guide
By Stas Bekman, Jim Brandt
By Stas Bekman, Eric Cholet
Existing CGI scripts will run much faster under mod_perl. And converting existing CGI scripts to run under mod_perl is easy.
For example, here's an existing CGI script called hello.cgi.
file:hello.cgi -------------- #!/usr/local/bin/perl -w use strict; use CGI; my $q = CGI->new; print $q->header, $q->start_html, $q->h1('Hello World!'), $q->end_html;
This script can now be run as-is under
Apache::Registry by using the
following configuration in httpd.conf:
<Files hello.cgi> SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI </Files>
That's basically it. Your scripts do need to be well coded, but
there's even the
Apache::PerlRun module to help with those "less
So how much faster do scripts run under
Obviously, it depends on the script, but the hello.cgi script above
ran at 7.3 requests per second as a CGI script and 243.0 requests per