Practical mod_perl / HTML Book /



previous page: 25.2.1.1. PerlOpenLogsHandler
  
page up: HTML Version of the book
  
next page: 25.2.1.3. PerlChildInitHandler

25.2.1.2. PerlPostConfigHandler


The post_config phase happens right after Apache has processed the configuration files, before any child processes are spawned (which happens at the child_init phase).

This phase can be used for initializing things to be shared between all child processes. You can do the same in the startup file, but in the post_config phase you have access to a complete configuration tree.

The post_config phase is very similar to the open_logs phase. The PerlPostConfigHandler directive may appear in the main configuration files and within <VirtualHost> sections. Apache will run all registered handlers for this phase until a handler returns something other than Apache::OK or Apache::DECLINED. This phase's handlers receive the same four arguments as the open_logs phase's handlers. From our example:

sub post_config {
    my($conf_pool, $log_pool, $temp_pool, $s) = @_;
    say("configuration is completed");
    return Apache::OK;
}

This example handler just logs that the configuration was completed and returns right away.

This handler is configured by adding the following to httpd.conf:

PerlPostConfigHandler Book::StartupLog::post_config

 

Continue to:

  • prev: 25.2.1.1. PerlOpenLogsHandler
  • Table of Contents
  • next: 25.2.1.3. PerlChildInitHandler







TOP
previous page: 25.2.1.1. PerlOpenLogsHandler
  
page up: HTML Version of the book
  
next page: 25.2.1.3. PerlChildInitHandler


Menu

  • HTML Book
  • PDF Book
  • Download Code
  • Table of Contents
  • Errata
  • mod_perl2 User's Guide
  • Sitemap

Search


Add to Google




Creative Commons License


Written by
Eric Cholet (Logilune) and
Stas Bekman (StasoSphere & Free Books).


[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007 StasoSphere.com