You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by sully <su...@rogers.com> on 2002/08/08 21:39:37 UTC

Re: Getting ugly: mod_perl and traditional forms of writing CGI

On 8/8/2002 at 2:44 PM Richard Dice wrote:

>> So the idea when migrating from CGI to mod_perl for this most-finished
> > project was: Change as little as possible.
>
>That's a very sound idea.  But I have a question:  regarding the piece of
>code that you provided here, is that the original code of the forum
>software, or your own hacked-upon version that you've been working on to
>try to get to work with mod_perl?
>
>My guess is the latter.  Here's the secret:  You don't have to do
>ANYTHING to a script to get it to work with mod_perl.  Just leave it
>be.

Yep, it's the latter all right. :) My requirements for this forum are only to integrate the user accounts with the site's overall accounts (no problem) and to allow people to post medium-length text pieces (around 5000 characters), which has become an issue. A good 75% of the time anything over 500 bytes in size submitted through the form gets ignored - the data POSTed *is* sent and received (verified by packet sniffer), it's just that either Apache or mod_perl doesn't pick this up. All of the other scripts (which take in minimal input and do a lot of output) work fine...in my limited-user test environment.

What I'm trying to understand is if this Apache/mod_perl input dropping problem is a symptom of a great problem that I'll eventually encounter with a large(r) base of users. A topic discussed here a few days ago (reread at http://mathforum.org/epigone/modperl/strooplexswoi ) sounded exactly like my issue, but whereas he apparently found a solution I have not.

>You do have to set up a <...> block of some sort or another, though.
>You can do it with a <Location> block, certainly, but there are errors
>in the <Location> block that you provided in your email.
>
>Think of a <Location> block, roughly speaking, as corresponding to a
>URL (URI, whatever).  What you're saying is that your /cgi-bin URL
>(URI, whatever) should be handled by Apache::Registry.  This is obviously
>no good. :-)  What you should do with your <Location> block might be
>something like this:
>
><Location /cgi-bin/kittens_community_script.cgi>
>     SetHandler perl-script
>     PerlHandler Apache::Registry
>     Options ExecCGI
>     PerlSendHeader On
></Location>
>
>Specifically, name the full URI (URL, whatever) that you want to be
>handled by the
>
>If you want *every* file in a directory to handled by Apache::Registry,
>then consider using a <Directory> block instead.  (Though I wouldn't
>recommend setting something like this up on your /cgi-bin directory,
>as it is kind of special.  Make a /modperl-bin directory and move
>your scripts into there instead, or something like that.)  You should
>brush up on <Location>, <Directory>, and <Files> (and <*Match> versions
>of each) run-time configuration directives at
>
>     http://httpd.apache.org/docs/mod/directives.html

Thanks, fixed. :) Hasn't changed the problem outlined above though.

>If your scripts are "dirty" then Apache::Registry might not be a good
>idea.  Use Apache::PerlRun instead in those cases.  You can read more
>about what constitutes a "dirty" scripts in the
>http://perl.apache.org/guide documentation.

99% of the code is running quite enthusiastically...in my test environment. I'll just have to see what happens when the load begins to climb.

>I notice that your email address is @rogers.com.  You don't happen
>to live in/around Toronto, do you?  (@rogers.com is big around here.)
>I only ask because then I would suggest that you come out to the
>monthly TPM (Toronto Perl Monger) meetings, so that you can learn
>from & network with other Perl-interested people in the GTA.
>Info is available from http://to.pm.org/  (Regardless of where
>you live, there might be a Perl Monger group in your area.
>Check out http://www.pm.org for a list of established groups.)

Lived in Toronto all my life, recently moved out to Mississauga. I've browsed over the T.O. Perl Monger's site but haven't given serious thought to coming down. If I can get this lousy site up and going I'll be definitely coming down the next time there's a meeting. :)

>Cheers,
>Richard
>
>-- 
>----------------------------------------------------------------------------
>  Richard Dice * Voice 416 841 7365 * Fax 416 841 7364
>  University of Toronto Rotman School of Management MBA Candidate
>  Class of 2004 * ShadNet Creator * http://shadnet.shad.ca
>  Occassional Writer, HotWired / Webmonkey * http://www.webmonkey.com
>  Speaker, Thunderlizard Web Design World Conferences
>    * http://www.thunderlizard.com

S. Syed


--------------------------------------------------------------------------------------------------
"A computer lets you make more mistakes faster than any invention 
in human history - with the possible exceptions of handguns and 
tequila." 						
                                                -- Mitch Ratliffe