Apache2 limit?

Discussion in 'Apache' started by andynic, Sep 27, 2010.

  1. #1
    Hi,
    I seem to have run into a limit and am wondering if there is a parameter that I can set, perhaps in the Apache Server, to overcome the problem.

    I am using Perl CGI to develop a simple database application. The code in question puts up a column of images in an html division. Please see the Perl code snippet and the resulting HTML in the attached file, PerlOrApacheLimit.txt.

    In a controlled experiment, I find that if the number of images displayed is up to 314 images (a complete html file of 8,413 lines), the system works correctly, but from 315 onwards (an html file of 8,438 liines), the system does not send back values in the CGI parameters. In both cases the html files pass validation using the W3 validator.

    What I mean by “the system does not send back values in the CGI parameters” is this: The page generated also contains buttons such as “Commit”, “Discard/Cancel” and so forth. These are made using <input type=”submit”…> tags. Up to 324 images (8,413 html lines), if the user clicks “Commit” for instance, the server sends to the main CGI routine via the cgi->param() function a value by which the Perl code determines the flow of events using commands like the following, :
    if ( $GCcgi->param("MIalbmToDsply") and
    not($GCcgi->param("MIcommit")) and
    not($GCcgi->param("MIdiscardChngs")) ) { MI_REFRESH($subNm); }

    if ( $GCcgi->param("MIcommit") ) { MI_COMMIT($subNm); }

    if ( $GCcgi->param("MIdiscardChngs") ) { MI_CANCEL($subNm); }

    (MI_COMMIT, for example, is a subroutine.)

    If the number of images is 315 or more (8,438 html lines or more), the $GCcgi->param() parameters are all null.

    Behaviour is the same using either Safari or Firefox.

    Is there some way around this? Perhaps an Apache Server (v2.2) parameter that needs to be set?

    Thanks for your help,
    Andynic
    Perl 5.10, Apache 2.2, Mac OS X 10.6
     

    Attached Files:

    andynic, Sep 27, 2010 IP
  2. andynic

    andynic Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The problem is solved.

    Someone some time ago, when I was just learning some perl and cgi, gave me this piece of code which I have been using verbatim in the current program:
    use CGI qw(param);
    use CGI::Carp 'fatalsToBrowser'; ## THE FOLOWING THREE LINES ARE TO
    $CGI::pOST_MAX=1024 * 100; # max 100K posts ## HELP protect against ANY DOS ATTACKS
    $CGI::DISABLE_UPLOADS = 1; # no uploads ## Do I need the line above and this?????

    By either increasing the POST_MAX value such as $CGI::pOST_MAX=1024 * 1024;
    or by commenting the line out altogether, the problem is solved.

    I'd like to find out more info about these cgi "parameters" and have done some searches but can't seem to find an "official" document that describes them all. If someone has an idea where I might find such documentation, please let me know.

    Thanks for your help,
    Andynic
     
    andynic, Oct 1, 2010 IP