Perl: the Markov chain saw | |
PerlMonks |
From mod_perl/Apache2 to FastCGI (Plack) ... wisdom soughtby sundialsvc4 (Abbot) |
on May 10, 2011 at 18:55 UTC ( [id://904015]=perlquestion: print w/replies, xml ) | Need Help?? |
sundialsvc4 has asked for the wisdom of the Perl Monks concerning the following question: Esteemed Monks, I can summarize my present quandary thusly: The Present: An application that was written (a long time ago...) to use mod_perl, and it is entirely a custom program in that the main program includes ... well, I’ll just let the source-code itself speak for the designer’s intentions:
The Goal: To get this application, as quickly and as simply as possible, to “the real world” of FastCGI and, ex minimis, to un-do the original coder’s apparently very-proud determination to “use libapreq instead of CGI.pm.” Even though the original coder was apparently very proud of his ability to “make two servers do the work of four,” the present reality is that very soon this legacy code base is going to have to support many different client-side platforms, and a very different server-side configuration, as well. So, I’ve got to eliminate these “clever tricks” that presently tie the code to ... well ... to the past. Specifically, this application ties into the httpd.conf file in the following way: ... and in the module itself ...
One thing that I do have going for me here is that the original code was intelligently designed by a very competent coder, such that all of the stuff that drives the web-interface is located in just one sub of just one module. There is only one other module that references Apache2, and this is just a seemingly-innocuous use Apache2::const, although there is also a use APR::Status which leads to the ominous-looking ... APR::Status::is_ECONNRESET($@) ... in a solitary if statement. I would like to make this change while minimizing (within reason...) the number of source-lines affected. The actual dispatching logic that is used by this application does make “a weird sort of sense,” which means that I actually might be able to simply drop a large number of the requests into it “as is.” But I do want to get rid of the logic that is dependent upon a mod_perl deployment and that extends quite so far into the guts of Apache. I would also like to maneuver this application so that it takes advantage of goodness like Plack while I’m here. Incidentally: the apparently-obvious question, “but what do you want to get rid of mod_perl for? ... mod_perl is perfection personified ... etc. ...“ can actually be put out-of-scope almost immediately. Within the easily-foreseeable future, this application is going to have several new deployments that will not allow for this kind of too-close wedding between Apache and the app. (In the majority of these, Apache won’t even exist.) I humbly petition for the Wisdom of the Monks in this regard. I shall count bit-beads upon my abacus while awaiting your reply.
Back to
Seekers of Perl Wisdom
|
|