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

Hi guys, Do you believe that the next perl version will offer a way to run "modperl" on apache/apache2, in a way wich will be safe to webhosts offer it to the virtual clients? Im asking because I really like to code perl and want to offer free script to webmasters, but actually people will prefer php because "cgi" is very slow :-(

Replies are listed 'Best First'.
Re: About perl6 and apache
by Corion (Patriarch) on Nov 16, 2006 at 10:45 UTC

    I'm not sure about mod_perl, because it will have to be rewritten for Perl6 (and/or Parrot) anyway. The issue to keep in mind here is that mod_perl has only one shared interpreter and namespace for one Apache process while it's desireable for shared hosting to separate them.

    I'm not sure if the approach used by mod_perl or mod_php is sensible enough anyway, because it doesn't allow finer-grained control and still has the possibility of leaking/accessing information of other contexts. There are other, well-supported frameworks like FastCGI, which keep every environment confined to its own process while avoiding the performance penalty of starting a process new for every page request.

Re: About perl6 and apache
by Limbic~Region (Chancellor) on Nov 16, 2006 at 13:33 UTC
    Anonymous Monk,
    As you may or may not know, Perl 6 is intended to be a complete specification such that multiple implementations are possible. The plan, to the best of my knowledge, is still to target Parrot in the primary implementation. Jeff Horwitz last year had a proof of concept mod_parrot working. Unfortunately, I think that this is on an extremely far back burner.

    Cheers - L~R

      :-) I really dont care how it will be named, but I hope that the system will allow us restart coding perl as free scripts to general webmasters use, actually I only see a real aplication to perl on dedicated servers where you will use modperl or fastcgi.... Looking at hotscripts.com we can take an idea of this... php is killing perl (for sure Im talking only about perl for web) .... The production of php is growing and perl is going down... and maybe this "bad" support for small projects wich runs under virtual accounts (and represent the majority) can to explain .... Also, the usage of Catalyst will not help for sure, will create more a problem... wich virtual host offer it? For my projects I use mason, but I will be on a dual dedicated server with modperl2 and all I need to run perl good .

        Catalyst runs under many configurations, like mod_perl, CGI, FastCGI or using its own server, so it offers many options depending on what your hosting service provides. There are tutorials here on how to install modules even without shell and root access, and also how to bundle up your applications together with all required modules so you don't need to rely on your hosting service to provide the stuff you need.

Re: About perl6 and apache
by perrin (Chancellor) on Nov 16, 2006 at 17:39 UTC
    Many web hosts run PHP under CGI, rather than running mod_php, because of the security issues, which are the same as running mod_perl or any other interpreter with the same permissions as the web server.

    For perl, you have 4 choices:

    • Use CGI. It's no slower than the PHP scripts being run under CGI.
    • Find a host that runs mod_perl. There are several of them and they're not that expensive.
    • Find a host that offers virtual servers. These give you a virtual machine with root and are quite cheap.
    • Find a host that offers FastCGI. There are plenty of these, and perl runs fine on FastCGI.
A reply falls below the community's threshold of quality. You may see it by logging in.