mod-perl2

Is it a bad idea to fork under mod_perl2?

混江龙づ霸主 提交于 2019-12-06 07:21:41
问题 Are there any counterindications to fork under mod_perl2? Should one use another way to run background process under mod_perl2? 回答1: I usually use a cleanup handler to run anything that needs to happen after the HTTP request is complete: $r->push_handlers( PerlCleanupHandler => sub { print "I'm doing stuff!" } ); If you really need to do a fork, you shouldn't do it the regular way, because your forked process will interfere with various resources that Apache needs, like file descriptors and

IPC::Open3 Fails Running Under Apache

强颜欢笑 提交于 2019-12-05 06:54:17
I have a module that uses IPC::Open3 (or IPC::Open2, both exhibit this problem) to call an external binary (bogofilter in this case) and feed it some input via the child-input filehandle, then reads the result from the child-output handle. The code works fine when run in most environments. However, the main use of this module is in a web service that runs under Apache 2.2.6. And under that environment, I get the error: Cannot fdopen STDOUT: Invalid argument This only happens when the code runs under Apache. Previously, the code constructed a horribly complex command, which included a here

Is it a bad idea to fork under mod_perl2?

拥有回忆 提交于 2019-12-04 12:14:34
Are there any counterindications to fork under mod_perl2? Should one use another way to run background process under mod_perl2? I usually use a cleanup handler to run anything that needs to happen after the HTTP request is complete: $r->push_handlers( PerlCleanupHandler => sub { print "I'm doing stuff!" } ); If you really need to do a fork, you shouldn't do it the regular way, because your forked process will interfere with various resources that Apache needs, like file descriptors and sockets, and it's very hard to handle all this correctly. Instead, try out Apache2::SubProcess . You might

PSGI: What is it and what's the fuss about?

只谈情不闲聊 提交于 2019-11-29 22:26:39
I have been trying to decide if my web project is a candidate for implementation using PSGI, but I don't really see what good it would do for my application at this stage. I don't really understand all the fuss. To me PSGI seems like a framework that provides a common interface between different Apache modules which lets you move your application between them. e.g Easily move your application from running on mod_perl to fastcgi, and provide the application support for running on both options. Is that right, or have I missed something? As I and the team I am a part of not only develop the