Return-Path: X-Original-To: apmail-perl-modperl-archive@www.apache.org Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 481E718BD7 for ; Sat, 15 Aug 2015 16:34:58 +0000 (UTC) Received: (qmail 61813 invoked by uid 500); 15 Aug 2015 16:34:57 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 61770 invoked by uid 500); 15 Aug 2015 16:34:57 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 61759 invoked by uid 99); 15 Aug 2015 16:34:57 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Aug 2015 16:34:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E8348DE12F for ; Sat, 15 Aug 2015 16:34:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.001 X-Spam-Level: X-Spam-Status: No, score=0.001 tagged_above=-999 required=6.31 tests=[URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id hZy8fstUkHg0 for ; Sat, 15 Aug 2015 16:34:41 +0000 (UTC) Received: from unix.inter-corporate.com (unix.inter-corporate.com [65.110.3.188]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id A18DE20786 for ; Sat, 15 Aug 2015 16:34:39 +0000 (UTC) Received: by unix.inter-corporate.com (Postfix, from userid 1006) id B3BBF76EA3C; Sat, 15 Aug 2015 09:30:59 -0700 (PDT) X-Envelope-To: modperl@perl.apache.org Received: from [10.1.1.186] (unknown [96.53.47.42]) (Authenticated sender: randolf.modperl.pl) by unix.inter-corporate.com (Postfix) with ESMTPA id 91BA276E97E for ; Sat, 15 Aug 2015 09:30:59 -0700 (PDT) From: "Randolf Richardson" Organization: Inter-Corporate Computer & Network Services To: modperl@perl.apache.org Date: Sat, 15 Aug 2015 09:34:34 -0700 MIME-Version: 1.0 Subject: Re: Enquiry about mod_perl project state Reply-to: randolf@modperl.pl Message-ID: <55CF6A1A.23295.9ED3512@randolf.modperl.pl> Priority: normal In-reply-to: <55CF403B.404@sanger.ac.uk> References: , <55CE2AB5.2964.50D8F4E@randolf.modperl.pl>, <55CF403B.404@sanger.ac.uk> X-mailer: Pegasus Mail for Windows (4.70) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body (This reply to Dr. James Smith's message is also intended for Ashish Mukherjee...) You're hooking in to more handlers than I typically do -- I hook into PerlAuthenHandler and PerlAuthzHandler (to implement a custom login system I created that uses one cookie, so it's been great that cookies are accessible at these stages), so that's two places (I found that I have to set up handlers for both or else neither works, which is fine because simply returning Apache2::Const::OK for authz is trivially easy). In my test environments, I use PerlInitHandler with Apache2::Reload, which I find does come with a slight performance hit, but that's okay because they're not as busy as the production environments. So, aside from that I use PerlRequire to load my main module (which includes the "authen" and "authz" handlers), and then I use the following stanza in a VirtualHost container in httpd.conf to handle all .pl files with mod_perl: SetHandler modperl PerlOptions +SetupEnv PerlResponseHandler ModPerl::Registry AddOutputFilter INCLUDES .pl Options +Includes +ExecCGI My main Perl module, at the authen() stage, connects to PostgreSQL with DBI using connect_cached, and then stores a referenced to itself with $r->pnotes, which is later used by all the .pl files in my web sites to use the same database connection (why waste CPU resources by reconnecting and re-processing the cookie twice when we can just re-use what's already been established in the authen() stage?). One of the nice things about using the pnotes mechanism is that it also means that I can write my .pl files in a generic manner so that they can easily be copied to other web sites that use different main modules (as long as I support the same functions for generating headers and footers, and other web site styling, which I do). For me, mod_perl has been an amazing productivity tool, and I've been building nearly all my web sites with it (where I don't use mod_perl is when all I need is plain HTML without any server-side functionality). One of the greatest things about using mod_perl is the consistently high performance it provides, even when enduring heavy traffic loads (there are limits, of course, but comparatively I find that mod_perl handles a lot more traffic than many other systems like PHP, and so hardware infrastructure costs are less overall too). > I agree with Randolf, > > I have watched a number of projects move away from mod_perl - often to > Dancer/ > Catalyst etc and then they ask can I do X, Y or Z... > > I say "if you were using mod_perl you could do that easily" but usually > find the tool chain for > doing something similar in Dancer or Catalyst is infinitely more > complex, because you can't > simply add a handler here or an output filter there. You can do this > with chained middleware > in Dancer but it is not that easy to implement... > > The main thing with mod_perl is - as long as Apache doesn't mess around > with the core HTTPD > interface (like they did with 2.4) then there isn't anything much that > needs changing - because > it is good solid and just works... If it ain't broke then it doesn't > need changing. > > I probably use more "pure" mod_perl - no registry scripts here thank > you! - and hook into the > apache process at about 7- 8 places to handle users, templating, > diagnostics, optimisation etc > > On 14/08/2015 18:51, Randolf Richardson wrote: > >> Hello, > >> > >> I wanted to enquire about the status of mod_perl, since there is largely an > >> impression it is end of life. The project site also does not say much. I > >> see many of the mod_perl shops now moving to perl Dancer/Mojolicious etc. > >> or going the Java way. > > I'm still using mod_perl to develop new web sites. The most recent > > one I've published is called the "atheist Blog Roll" and it uses a > > PostgreSQL database in the back-end: > > > > http://www.atheistblogroll.com/ > > > > There are other projects on my horizon that continue to be developed > > in mod_perl, and they range from simple web sites to fully > > interactive projects. > > > > When there is a need for a client-side application, I use Java > > because I only have to write the code once to gain support on > > multiple Operating Systems (e.g., Unix/Linux, Windows, MacOS), and if > > it needs to interact with a web site, then I typically use mod_perl > > for that end of things. > > > > For one of the projects I'm working on (which is not ready for > > public consumption quite yet), I've also written a WHOIS server using > > mod_perl (which listens on TCP port 43, and responds to queries based > > on its findings in PostgreSQL) to facilitate public membership record > > lookups (only for the portions that will be publicly accessible). > > > >> What is the future of mod_perl beyond mod_perl 2.0? What is the upgrade > >> path recommended by the mod_perl veterans? > > When I upgrade, I'm normally installing new server hardware and so I > > migrate sites over one at a time, and resolve any API change > > requirements before promoting the new server to production (followed > > by log file merges after switching servers and traffic to the old > > servers cease). > > > >> Regards, > >> Ashish > > Randolf Richardson - randolf@inter-corporate.com > > Inter-Corporate Computer & Network Services, Inc. > > Beautiful British Columbia, Canada > > http://www.inter-corporate.com/ > > > > > > > > -- > The Wellcome Trust Sanger Institute is operated by Genome Research > Limited, a charity registered in England with number 1021457 and a > company registered in England with number 2742969, whose registered > office is 215 Euston Road, London, NW1 2BE. Randolf Richardson - randolf@inter-corporate.com Inter-Corporate Computer & Network Services, Inc. Beautiful British Columbia, Canada http://www.inter-corporate.com/