Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

How common is mod_perl?

by jerrygarciuh (Curate)
on Feb 14, 2002 at 02:58 UTC ( #145350=perlquestion: print w/replies, xml ) Need Help??

jerrygarciuh has asked for the wisdom of the Perl Monks concerning the following question:

I am preparing to invest some time learning a templating module. I am intrigued by HTML::Mason 's capabilities but I understand from Mouse (2nd ed.) that it essentialy requires (not require) mod_perl. My question to the brethren is whether this should desuade me from learning it and send me to HTML::Template instead. Advice is appreciated.
TIA
jg
_____________________________________________________
Can a bus sativa?

Replies are listed 'Best First'.
Re: How common is mod_perl?
by trs80 (Priest) on Feb 14, 2002 at 03:30 UTC
    For me I would need to know more about what you are working on or hope to be working on before I could whole heartly recommend investing in learning mod_perl. I have been using mod_perl since at least 1998 and there is a lot I still don't know about it. I have done most of my work with it at the templating/framework level with modules such as HTML::Embperl and Apache::ASP. Based on this I would recommend mod_perl if:
    • You have a development machine with root access
    • You have at a minimum, access to the log files on the production machine
    • You have some way to stop and start the mod_perl (httpd) process on the production server easily.
    • You are doing large scale applications.

    mod_perl was complete overkill for the first project I used it on, but for me it was more the fun of learning it then it was the need for the performance. If you are going to do large scale developemnt and need the performance make sure you read the mod_perl Guide before you even start to install it or work with it.

    mod_perl is awesome if used correctly, but can quickly create a lot of head scratching that you might be able to avoid if you don't need the extra power it provides.
      Thank you very much for your incisive response! I actually don't have any particular project in mind but wanted to invest my learning wisely. Your response has been very helpful in giving me some criteria to apply to my thinking!
      jg
      _____________________________________________________
      If it gets a little bit out of hand sometimes, don't let it fool you into thinkin' you don't care.TvZ
(jeffa) Re: How common is mod_perl?
by jeffa (Bishop) on Feb 14, 2002 at 03:12 UTC
    The fact that i prefer HTML::Template should be well known around here by now, but even with that bias i say learn it first anyway. I should also mention that i use HTML::Template with mod_perl as well. Good stuff!!

    How common is mod_perl? Common enough for me. ;)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re: How common is mod_perl?
by joealba (Hermit) on Feb 14, 2002 at 03:13 UTC
    mod_perl really gives you some power that no other web servers offer right now. I see all other web servers eventually moving towards a model similar to mod_perl, if they're smart -- but none have done it yet.

    So, I say learn HTML::Mason. Okay, mod_perl is difficult. There's not a lot of documentation that will spell everything out for you letter by letter. But when you're done, it'll give you a very marketable skill and a deeper knowledge of what web servers are capable of.

    Besides... once Apache 2.0 gets stable and becomes mainstream, who'd be stupid enough to run anything else? :)

    I've only gotten a small taste of what mod_perl can do. If anyone has some really great documentation links, please post here. Thanks! (All my good mod_perl links are in my bookmarks at work.. I'll post mine here tomorrow AM EST.)
Re: How common is mod_perl?
by gav^ (Curate) on Feb 14, 2002 at 04:02 UTC
Re: How common is mod_perl?
by lachoy (Parson) on Feb 14, 2002 at 04:08 UTC

    To answer your question another way: mod_perl usage statistics were recently discussed on the mod_perl mailing list.

    And once you use Template Toolkit for templating, you'll be spoiled for everything else :-)

    Chris
    M-x auto-bs-mode

Re: How common is mod_perl?
by random (Monk) on Feb 14, 2002 at 04:20 UTC

    It may, perhaps, be rude to answer a question with a question, but I certainly think it in the spirit of the Monastery:

    Why would the mod_perl requirement dissuade you from learning HTML::Mason?

    I can think of a few possibilities. One, that you feel a bit daunted by the task of learning two new systems whereas HTML::Template does not require that extra bit of work. This is a valid objection, and if you are very eager to get a templating system under your belt, certainly work on HTML::Template first, but put both mod_perl and Mason on your to-do list.

    My second thought is that you may not be interested in learning mod_perl because you may not think it applies to what you're doing right now. That may very well be true, but it never hurts to learn something new. You can always find new places to apply knowledge, and acquiring more never hurts.

    -Mike-

      Actually, my line of thought was basically just my subject line. If mod_perl were significantly uncommon the HTML::Mason becomes less attractive 'cause I couldn't use it on many servers. Thanks for your input. I think I may well follow your advice and do Template first the learn about mod_perl later. I am still a perl newbie, no sense muddling my head with deeper levels just yet.
      jg
      _____________________________________________________
      Never get into a land war in Asia, and never go in against a Sicilian when death is on the line!
Re: How common is mod_perl?
by kwoff (Friar) on Feb 14, 2002 at 09:43 UTC
    mod_perl is pretty common, and I think any site using Perl CGI would prefer if possible to hook into mod_perl for the performance boost (by using Apache::Registry or something). If you're planning to do much web development with Perl, it's useful to learn mod_perl. Learning mod_perl also helps you understand how Apache itself works. So an argument for learning mod_perl (or anything) is that the extra knowledge will help you make better decisions than if you don't know it.

    However, I think HTML::Mason doesn't really require much mod_perl knowledge. It would help you understand what's going on underneath, but you could learn HTML::Mason at a more conceptual level if you wanted. If the main reason you wouldn't learn HTML::Mason is because you're intimidated by mod_perl, I think you can eliminate that reason. The hardest part of HTML::Mason when I first learned it was the initial Apache configuration, but it's well documented and there's a mailing list to read archives or ask questions.

    Typically with HTML::Mason, you put HTML at the top of a template page and some Perl at the bottom. The HTML will have special tags in it, similar to JSP or ASP. Then below it, you'll put some Perl code to initialize variables. But I think the powerful thing about HTML::Mason is its "object-orientedness". You can use "autohandlers" to automatically produce parts of the pages, and you can use "methods" that are object-oriented so you can override them and whatnot. I guess in the end it might be just what fits best with your style, so maybe HTML::Template or Template Toolkit makes more sense for you. But knowing mod_perl will still be useful anyway.

Re: How common is mod_perl?
by IlyaM (Parson) on Feb 14, 2002 at 09:56 UTC
    HTML::Mason 's capabilities but I understand from Mouse (2nd ed.) that it essentialy requires (not require) mod_perl

    It is not true. Mason doesn't actually require mod_perl. It can run as CGI (however it will be very slow). Moreover I've been using it as standalone command line HTML generator.

    See HTML::Mason FAQ. Here and here.

    --
    Ilya Martynov (http://martynov.org/)

      Mason doesn't actually require mod_perl. It can run as CGI (however it will be very slow).
      Does this mean, mod_perl only provides Mason the persistent CGI process capability? Or, are any other capabilities of mod_perl taken advantage of by Mason?

      Put in another way, if the persistence of CGI processes is provided by in a non-mod_perl way (example, FastCGI or SpeedyCGI), does Mason work as effectively as in a mod_perl environment?

      Thanks,
      /prakash

        Does this mean, mod_perl only provides Mason the persistent CGI process capability? Or, are any other capabilities of mod_perl taken advantage of by Mason?

        That's right. Mason mostly needs mod_perl for persistence. However there are some sweeties only avialable if you use Mason under mod_perl. Like simple configuration via apache config files and access to Apache API.

        Put in another way, if the persistence of CGI processes is provided by in a non-mod_perl way (example, FastCGI or SpeedyCGI)

        I heard about people who use Mason this way. You can find some info about it in mason maillist archives.

        --
        Ilya Martynov (http://martynov.org/)

Re: How icommon/i is mod_perl?
by novitiate (Scribe) on Feb 14, 2002 at 06:38 UTC
    how common is mod_perl ? ... it is by no means common.
    What is it's frequency ?
    Look here to see:  Netcraft - mod_perl
    As you will notice, it is enjoyed by many and the numbers are promising.

    humbly,
    novitiate

    "...goodnight you princes of main(e)"  --The Cider House Rules
Re: How common is mod_perl?
by perrin (Chancellor) on Feb 14, 2002 at 17:19 UTC
    mod_perl is very common in companies that use Perl to build real sites and care about performance. It is not common on cheap ISPs that only provide shared access. So, if you intend to get a job working in any serious Perl-based web shop you should expect to work with mod_perl. If you intend to do one-off contracting jobs for people who want to pay rock-bottom prices, you're probably stuck with CGI.
Mod perl docs
by hakkr (Chaplain) on Feb 14, 2002 at 11:54 UTC
Re: How common is mod_perl?
by TGI (Parson) on Feb 16, 2002 at 10:46 UTC

    I've been using mason for a while now, and I am very happy with it's capabilities. Cool stuff like automatic interception and processing of 404s, argument handling, autohandles, sub-components, inheritable methods keeps me busy trying to figure out how best to utilize it all. The thing that I have found I love most of all, though is the snappy way Mason handles parameters.

    A while back, I wanted to learn a templating system. Since I run a little intranet server, and I'm always on the lookout for useful applications I can install and put to use, I looked at what tools were available that I wanted to use, and what they were made with. Tools like Mason-CM, RT, Bricks and Bricolage are all implemented in Mason. We are currently using Mason-CM, customizing RT for use as a workflow tool, and are considering moving some of our documentation to Bricolage. There's some mighty cool stuff out there.

    The one thing that mars my love-affair with Mason, is the difficulty I am having finding a cheap host for mason-stuff. To get mason to run in CGI mode, you still need to make changes to the apache config file, which may not be available. Many sites also use mod_perl compiled as a DSO instead of staticly compiled into Apache. There is a bug in mod_perl that Mason treads on hard and often. When used in this configuration Apache tends to seg-fault or die at startup. Not good. Several companies I have contacted were not willing to do a static compile of Apache/mod_perl. It's tempting to use one of them anyway and crash, crash, crash their servers until they repent. But I'm a nice guy.

    I have been working with someone on the Mason-Users list to come up with a technique for using mason on a server where you have very minimal access (must install modules into your homedirectory, minimal .htaccess controls, and perl cgi only). I haven't heard from him in a while, so I'm not sure when it will be ready. When it is done, I will post it at masonhq.


    TGI says moo

Re: How common is mod_perl?
by Anonymous Monk on Feb 15, 2002 at 15:29 UTC
    if u can invest some time in learning mod_perl U will be awarded for your time.. short desc of the benefits :
    - speed
    - u can work with the Apache innyards and do things u cant do in other way... and this with you favorite Perl
    the drawback is that mod_perl is memory hungry, but with a good policy this can be solved.
    U can start with perl.apache.org. Look at the mod_perl guide it is very troutghfull and u can find answer on almost all of your questions.
    I preffer to use Template-Toolkit (rich-language,compilation on disk, sharing one Template object over all scripts..etc..). , but all template system will benefit from using mod_perl
    I also use Apache::ASP (www.apache-asp.org) and I'm very comfortable with it.. not to mention that it has much greater functionality than MS ASP.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://145350]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2022-07-06 09:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?