Re: reinitializing Perl's notion of $$ in mod_perl
Mark Blackman wrote: On 15 Apr 2008, at 13:51, Mark Blackman wrote: While I did find Torsten Förtsch's very useful Perl::AfterFork module, surely the mod_perl code must be doing something like this itself, no? I'd be grateful to understand mod_perl's response to Perl's pid caching is, given that forking *will* happen in the mod_perl environment. Ok, more investigation suggests we're seeing an ordering problem. mod_perl (2.0.3) does reinitialize $$ in modperl_hook_child_init in mod_perl.c by calling void modperl_perl_init_ids_server(server_rec *s) in modperl_perl.c However, judicious sprinkling of printf statements suggests very strongly that the above code gets called *AFTER* the handler specified in PerlChildInitHandler. That's most likely correct. From src/modules/perl/mod_perl.c: ap_hook_child_init(modperl_hook_child_init, [...]); /* Handler for $$ */ modperl_register_handler_hooks(); /* Handler for PerlChildInit */ So I assume the hook ordering for the same level is LIFO. Would anyone are to comment why the code above would be done AFTER? It shouldn't be, IMO. The routine names suggest that modperl_hook_child_init() would get called before a PerlChildInitHandler to me, but my logging suggests otherwise. Can you try this simple patch and see if it makes your troubles go away. Untested Index: src/modules/perl/mod_perl.c === --- src/modules/perl/mod_perl.c (revision 643757) +++ src/modules/perl/mod_perl.c (working copy) @@ -896,7 +896,7 @@ NULL, NULL, MODPERL_HOOK_REALLY_REALLY_FIRST); ap_hook_child_init(modperl_hook_child_init, - NULL, NULL, APR_HOOK_FIRST); + NULL, NULL, MODPERL_HOOK_REALLY_REALLY_FIRST); modperl_register_handler_hooks(); } /Untested -- Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5 http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/ signature.asc Description: OpenPGP digital signature
Re: reinitializing Perl's notion of $$ in mod_perl
On 16 Apr 2008, at 08:42, Philippe M. Chiasson wrote: Can you try this simple patch and see if it makes your troubles go away. It does indeed have the desired effect of getting $$ reset to the child pid by the time the PerlChildInitHandler handler is called. - Mark Untested Index: src/modules/perl/mod_perl.c === --- src/modules/perl/mod_perl.c (revision 643757) +++ src/modules/perl/mod_perl.c (working copy) @@ -896,7 +896,7 @@ NULL, NULL, MODPERL_HOOK_REALLY_REALLY_FIRST); ap_hook_child_init(modperl_hook_child_init, - NULL, NULL, APR_HOOK_FIRST); + NULL, NULL, MODPERL_HOOK_REALLY_REALLY_FIRST); modperl_register_handler_hooks(); } /Untested -- Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5 http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm) \.org/
Re: reinitializing Perl's notion of $$ in mod_perl
On 16 Apr 2008, at 10:24, Mark Blackman wrote: On 16 Apr 2008, at 08:42, Philippe M. Chiasson wrote: Can you try this simple patch and see if it makes your troubles go away. It does indeed have the desired effect of getting $$ reset to the child pid by the time the PerlChildInitHandler handler is called. I'm not quite sure what the positive result here suggests. Is that patch appropriate as a long term fix? Should it be part of 2.0.4? - Mark - Mark Untested Index: src/modules/perl/mod_perl.c === --- src/modules/perl/mod_perl.c (revision 643757) +++ src/modules/perl/mod_perl.c (working copy) @@ -896,7 +896,7 @@ NULL, NULL, MODPERL_HOOK_REALLY_REALLY_FIRST); ap_hook_child_init(modperl_hook_child_init, - NULL, NULL, APR_HOOK_FIRST); + NULL, NULL, MODPERL_HOOK_REALLY_REALLY_FIRST); modperl_register_handler_hooks(); } /Untested -- Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5 http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm) \.org/
Re: Accessing CSS,JS and other files
It worked...:jumping: Thank you... Michael Peters wrote: Dileep Eduri wrote: When I searched thru' forums, came to know abt the Files section, which I can use. But still after studying the documentation, I could not write a proper Files section. You don't need to use a Files section. PerlModule ModPerl::Registry Location /perl SetHandler perl-script PerlHandler ModPerl::Registry Options ExecCGI allow from all PerlSendHeader On /Location One way is to simply not put the files under /perl :) If you have to do that, then put them in a different directory. Say /perl/assets? or /perl/css, etc. Then do something like: Location /perl/assets SetHandler default /Location -- Michael Peters Plus Three, LP - With Best regards, Dileep. *** -- View this message in context: http://www.nabble.com/Accessing-CSS%2CJS-and-other-files-tp16703625p16722557.html Sent from the mod_perl - General mailing list archive at Nabble.com.
Access to Server and Request objects under Registry
Hello! Is there any way to access server and request objects when script is running under Registry? -- Regards, Artem
RE: [RELEASE CANDIDATE] mod_perl-2.0.4 RC1
Tested on: Windows 2003 R2 32 bit Activestate perl build 822 ASF Apache 2.2.8 With: Visual C express 2005. To successfully build you need to make manifest files for httpd.exe and perl.exe After all this is done: Two tests fail: t\modperl\setauth...ok t\modperl\setupenv..FAILED tests 8, 22, 29, 36, 50, 57 Failed 6/63 tests, 90.48% okay t\preconnection\note# Failed test 1 in t\preconnection\note. t at line 16 t\preconnection\noteFAILED test 1 Failed 1/1 tests, 0.00% okay Tested on: Windows XP SP2 32 bit Activestate perl build 1002 ASF Apache 2.2.8 With: Visual Studio .NET 2003 All test passed OK - - - Thomas den Braber
Re: Access to Server and Request objects under Registry
my $r = shift; at the top of your file running under registry should work. You can also use Apache-request in mp1, or Apache2::RequestUtil-request in mp2 (if you're using the prefork mpm) Adam Quoting Artem Kuchin [EMAIL PROTECTED]: Hello! Is there any way to access server and request objects when script is running under Registry? -- Regards, Artem
Re: Access to Server and Request objects under Registry
Artem Kuchin wrote: Hello! Is there any way to access server and request objects when script is running under Registry? # From the top-level my $r = shift; OR # PerlOptions +GlobalRequest # Apache2::RequestUtil (http://perl.apache.org/docs/2.0/api/Apache2/RequestUtil.html#C_request_) use Apache2::RequestUtil; my $r = Apache2::RequestUtil-request -- Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5 http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/ signature.asc Description: OpenPGP digital signature
Session handling
Hi, for session handling we use CGI:Session cpan distribution, we do use local file for cookie storage, eventhough the session time out is 30, sometimes the set information in the session get lost before that, has anybody experience this before. We do have a cron job to clear the session data, Is there any solution for this behavior? What exactly the possible reason for such a thing. After the authentication I do set the logged in userin in the session and use the sessionId for subsequent requests Thanks -- View this message in context: http://www.nabble.com/Session-handling-tp16738934p16738934.html Sent from the mod_perl - General mailing list archive at Nabble.com.