![]() |
Practical mod_perl / HTML Book / | ![]() |
||
![]() |
||||
![]() |
![]() |
|||
![]() |
![]() |
|||
![]() |
||||
|
|
||||
![]() |
![]() |
|||
![]() |
24.5.3. Startup File |
![]() |
||
![]() |
||||
![]() |
![]() |
![]() |
||
![]() |
||||
Next, a startup file with Perl code usually is loaded:
PerlRequire "/home/httpd/httpd-2.0/perl/startup.pl"
It's used to adjust Perl module search paths in @INC, preload commonly used modules, precompile constants, etc. A typical startup.pl file for mod_perl 2.0 is shown in Example 24-1.
use Apache2 ( ); use lib qw(/home/httpd/perl); # enable if the mod_perl 1.0 compatibility is needed # use Apache::compat ( ); # preload all mp2 modules # use ModPerl::MethodLookup; # ModPerl::MethodLookup::preload_all_modules( ); use ModPerl::Util ( ); #for CORE::GLOBAL::exit use Apache::RequestRec ( ); use Apache::RequestIO ( ); use Apache::RequestUtil ( ); use Apache::Server ( ); use Apache::ServerUtil ( ); use Apache::Connection ( ); use Apache::Log ( ); use APR::Table ( ); use ModPerl::Registry ( ); use Apache::Const -compile => ':common'; use APR::Const -compile => ':common'; 1;
In this file the Apache2 module is loaded, so the 2.0 modules will be found. Afterwards, @INC is adjusted to include nonstandard directories with Perl modules:
use lib qw(/home/httpd/perl);
If you need to use the backward-compatibility layer, to get 1.0 modules that haven't yet been ported to work with mod_perl 2.0, load Apache::compat:
use Apache::compat ( );
Next, preload the commonly used mod_perl 2.0 modules and precompile the common constants. You can preload all mod_perl 2.0 modules by uncommenting the following two lines:
use ModPerl::MethodLookup; ModPerl::MethodLookup::preload_all_modules( );
Finally, the startup.pl file must be terminated with 1;.
 
Continue to:
mod_perl, modperl, Apache, perl, cgi, html, mod_perl, e-commerce, scalability, free, open source, OSS, apache, squid, high availability, modperl, linux, unix, Web, www, mod_perl, webserver, admin, apache, book, webmaster, tools, modperl, guide, docs, documentation, help, mod_perl, perl, information, apache, script, errata, eric cholet, perl, apache, mod-perl, stas bekman, mod_perl, cool, perl, Apache, performance, speed, choice
![]() |
Other projects to check out: meta-religion.com is for those interested in Religious, Spiritual and Esoteric Phenomena. i-want-a-better.com is a community of people discussing what they would like to be improved in their lives and things they use and interact with. You may also want to find a healer in your area or read articles on variety of topics.