Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Apache Registry with Server Side Includes

by bbfan (Novice)
on Jan 01, 2012 at 19:19 UTC ( [id://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!

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.)
      http://httpd.apache.org/docs/2.0/mod/mod_include.html
        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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://945804]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-03-19 06:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found