mod_perl Server Configuration
FIXME: DESCRIPTION
pass switches to the Perl command line. For example, to enable warnings:
PerlSwitches -w
set the trace level. This directive is enabled when mod_perl is compiled with the MP_TRACE option. level is either:
level
all
which sets maximum logging and debugging levels;
a combination of one or more option letters (or option numerical equivalents) from the following list:
d ( 1) directive processing f ( 2) filters g ( 4) Perl runtime interaction h ( 8) handlers i ( 16) interpreter pool management m ( 32) memory allocations s ( 64) perl sections t (128) benchmark-ish timings
When level is not specified, the tracing level will be set to the value of the MOD_PERL_TRACE environment variable.
These directives are enabled only in a threaded mod_perl+Apache combo.
Number of Perl interpreters to start
Max number of running Perl interpreters
Max number of spare Perl interpreters
Min number of spare Perl interpreters
Max number of requests per Perl interpreters
Scope for which selected interpreter should be held, one of: request, connection, handler, subrequest.
The default is request.
Enable/Disable Options. Options include:
Create a new parent Perl interpreter for the given VirtualHost and give it its own interpreter pool (implies Clone).
Share the parent Perl interpreter, but give the VirtualHost its own interpreter pool.
Use:
PerlSwitches +inherit
to inherit base Perl interpreter's PerlSwitches.
PerlSwitches
On by default, used to disable mod_perl for a given VirtualHost.
Disable Perl*Handlers, all compiled in handlers are enabled by default.
Resolve Perl*Handlers at startup time, includes loading the module from disk if not already loaded.
Setup the global request_rec for use with Apache->request
Scan output for HTTP headers, same functionality as 1.x's PerlSendHeaders, but more robust.
Turn on merging of Perl*Handler arrays, example:
PerlFixupHandler One::fixup <Location /foo> PerlFixupHandler Another::fixup </Location>
By default, a request for /foo only runs Another::fixup (1.x behavior) PerlOptions +MergeHandlers (inside Location /foo) will run both One::fixup and Another::fixup.
Examples:
# disable mod_perl for this host <VirtualHost ...> PerlOptions -Enable </VirtualHost> # create 2 Parent Perls, # each pointing to a different developer library tree <VirtualHost ...> ServerName dev1 PerlOptions +Parent PerlSwitches -Mblib=/home/dev1/lib/perl </VirtualHost> <VirtualHost ...> ServerName dev2 PerlOptions +Parent PerlSwitches -Mblib=/home/dev2/lib/perl </VirtualHost> # give VirtualHost its own interpreter pool <VirtualHost ...> PerlOptions +Clone PerlInterpStart 2 PerlInterpMax 2 </VirtualHost> # disable handlers <VirtualHost ...> PerlOptions -Authen -Authz -Access </VirtualHost>
The httpd server startup options can retrieved using Apache::exists_config_define(). For example this checks whether the server has been started in a single mode:
Apache::exists_config_define()
if (Apache::exists_config_define("ONE_PROCESS")) { print "Running in a single mode"; }
Maintainer is the person(s) you should contact with updates, corrections and patches.
Doug MacEachern <dougm (at) covalent.net>
Only the major authors are listed above. For contributors see the Changes file.
To install mod_perl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm mod_perl
CPAN shell
perl -MCPAN -e shell install mod_perl
For more information on module installation, please visit the detailed CPAN module installation guide.