Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^3: Apache Registry with Server Side Includes

by bbfan (Novice)
on Jan 02, 2012 at 14:58 UTC ( #945924=note: print w/replies, xml ) Need Help??

in reply to Re^2: Apache Registry with Server Side Includes
in thread Apache Registry with Server Side Includes

Hello Monks,

Although the problem of getting a SSI-invoked script into Apache Registry was "solved", it seems that the scripts in my (and maybe your?) Apache Registry directory take on a behavior that is, in my case, undesired. Specifically, calling the same script several times within a SSI-parsed file causes each invocation of the script to use the same argument as was passed in from the first invocation.

To clarify, please find inlined below a simple SSI/shtml file and a script:

<!-- file test.shtml --> <html> <head></head> <body> <!--#include virtual="/cgi-bin/test.cgi?count=5"--> <!--#include virtual="/cgi-bin/test.cgi?count=10"--> <!--#include virtual="/cgi-bin/test.cgi?count=30"--> </body> <html> #!/usr/bin/perl -w # test.cgi use strict; use CGI qw(-compile :all); my $count = param('count'); my $a = 0; print header; while ( $a < $count) { print ++$a; }

When run from the default /var/www/cgi-bin/ directory, execution works as expected. However, when run from the Apache Registry directory below, each invocation counts only to 5.

<Directory /var/www/registry> SetHandler perl-script PerlResponseHandler ModPerl::Registry # PerlOptions +ParseHeaders (prevented 2+ invocations) Options +ExecCGI </Directory>

Any insights would sure be appreciated... Thanks!

Replies are listed 'Best First'.
Re^4: Apache Registry with Server Side Includes
by Eliya (Vicar) on Jan 02, 2012 at 15:24 UTC

    Try using CGI::Simple instead of (at least for testing purposes).   I've occasionally seen similar weirdness with (i.e. parameters not being cleared/reread upon subsequent requests) when being used in persistent contexts, and switching to CGI::Simple fixed it.

      Eliya, Thanks for the suggestion to use CGI::Simple. Had not used it before. Changed:

      use CGI qw(-compile :all);
      use CGI::Simple::Standard qw(param header);
      without success. Same results.

      Regarding the "-nosticky" mentioned in another post, came across the same documentation that clarify what nosticky does, and does not, do; nice to get confirmation on that, thanks.

      Was initially thinking that the issue was with ModPerl::Registry or mod_include, but it sounds like may be influencing the result? Recall that this works as expected when ModPerl::Registry is removed from the equation.

      Am wondering if any readers may have time to reproduce the issue using the code/config in this thread, thus eliminating something that is particular to my installation?

        Hmm.  Are you sure cou haven't disabled SetupEnv somewhere (e.g. globally)?  It should be "on" by default, but maybe try enabling it explicitly:

        ... PerlOptions +SetupEnv
Re^4: Apache Registry with Server Side Includes
by Anonymous Monk on Jan 02, 2012 at 17:22 UTC

    Any insights would sure be appreciated... Thanks!

    A feature is a feature, read the docs, look for "sticky"

      If you're referring to this feature

      "By default the CGI module implements a state-preserving behavior called "sticky" fields. The way this works is that if you are regenerating a form, the methods that generate the form field values will interrogate param() to see if similarly-named parameters are present in the query string. If they find a like-named parameter, they will use it to set their default values."

      I don't think this has anything to do with what the OP is observing. There's no "regenerating a form" in the above code. Actually, there's no form involved at all, as the OP is directly supplying the parameter in the URLs called via SSI. A directly specified value ?count=10 should clearly override any value from a previous request.

        I don't think this has anything to do with what the OP is observing.


        But, there is no way the OP could observe anything like he claims :) "ModPerl::Registry" does not support SSI

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://945924]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2018-05-21 19:40 GMT
Find Nodes?
    Voting Booth?