Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^2: Apache Registry with Server Side Includes

by bbfan (Novice)
on Jan 01, 2012 at 21:52 UTC ( #945811=note: print w/replies, xml ) Need Help??

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

Moritz - Thank you. Your answer solved the problem. Scripts called using "#include virtual" are registry-ized.

FWIW, was using:

<!--#exec cmd="script arg1=x arg2=y"-->
The doc clearly indicates using "virtual" over "exec" (and gives the added benefit passing in params the CGI way.)

Replies are listed 'Best First'.
Re^3: Apache Registry with Server Side Includes
by bbfan (Novice) on Jan 02, 2012 at 14:58 UTC
    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!

      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?

      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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2018-05-27 20:02 GMT
Find Nodes?
    Voting Booth?