mod_perl provides a number of server lifecycle handlers, which allow you to hook various parts of the initiation sequence to log configuration files or logging before Apache starts handling your individual requests. Unfortunately, for reasons still not clear, when I tried to run initialization in the PerlChildInitHandler, it would correctly initialize but then the values would get re-initialized back to defaults when the PerlReponseHandler fired.
The solution, and not all that satisfying, was to switch to the PerlPostConfigHandler, which did not suffer from that problem and has the added benefit of using shared memory across the multiple processes.
PerlModule Handler PerlModule Apache2::Reload PerlOpenLogsHandler Handler::open_logs PerlPostConfigHandler Handler::post_config PerlSetVar ReloadDirectories ¨/mnt/hgfs/src/api/lib¨ <Location /event> SetHandler modperl PerlResponseHandler Handler::handler PerlInitHandler Apache2::Reload </Location>
John
September 11, 2010 at 1:01 am
hey, nice blog…really like it and added to bookmarks. keep up with good work
James
September 11, 2010 at 3:18 am
hey there, this might be little offtopic, but i am hosting my site on hostgator and they will suspend my hosting in 4days, so i would like to ask you which hosting do you use or recommend?