Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Apache Registry with Server Side Includes

by bbfan (Novice)
on Jan 01, 2012 at 19:19 UTC ( #945804=perlquestion: print w/replies, xml ) Need Help??
bbfan has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

Have a site with several scripts running fine with Apache Registry. There are also a couple (shtml) files that execute other scripts. The problem is that the (other) scripts executed via SSI do not get "Apache::Registry-ized"; instead, they require a new PID for each execution.

One way to get all the scripts "compiled and waiting" seems to be a rewrite that would eliminate the need for SSI execution of the scripts.

Prior to doing that, am wondering what other options might exist.

Many thanks for your consideration!

  • Comment on Apache Registry with Server Side Includes

Replies are listed 'Best First'.
Re: Apache Registry with Server Side Includes
by moritz (Cardinal) on Jan 01, 2012 at 19:54 UTC

    If you use <!--#inculde virtual="..." --> instead of file="...", mod_include does an internal request, which executes CGI scripts in the same way as if they were called externally.

    Is that what you want? If not, please be more specific, and show some code (relevant apache config, scripts, includes, ...) and desired and actual output.

      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.)
        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!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://945804]
Approved by Corion
Front-paged by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2018-07-23 07:44 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (459 votes). Check out past polls.