modperl-apache_registry_setup_hints

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



To: <modperl@apache.org>
From: "Rodney Broom" <rbroom@Desert.NET>
Subject: Re: Help Apache::Registry Setup
Date: Fri, 15 Jun 2001 12:55:58 -0700

From: Purcell, Scott <spurcell@ltcgroup.com>

> I found that there is a folder called mod_perl and if I put my counter.cgi
> file there that it ran mod-perl (or PERSISTANT).
>
> I put the code block you sent me in the httpd.conf file and restarted the
> server, then renamed a file that was under cgi-bin to counter.mpl
(thinking
> that the .mpl linked the file to mod-perl), but I get an error stating:
> You don't have permission to access /cgi-bin/counter.mpl on this server.
>
>
> Anyway, should I be able to put .mpl files anywhere under the cgi-bin
> directory with that snippet of code, or do all mod-perl files have to live
> under the mod-perl folder?


The chunk of config that I sent:
 <FilesMatch  "\.mpl$">
   SetHandler perl-script
   PerlHandler Apache::Registry
 </FilesMatch>

Is one of several ways to get mod_perl to run your Perl code instead of
something else (like /usr/bin/perl). What I've done here is to tall Apache
to look for files that end in '.mpl' and hand them off to the given handler
(Apache::Registry). Try this script:

  # rodney.mpl
  printf qq{PID [$$] First is %sdefined [$first].<br>\n}, $first ? '' : 'not
';
  $first = time;

You'll notice that there's no reference to the Perl interpreter, that's OK.
mod_perl already has a Perl interpreter in memory and knows what to do with
your code. Make sure to set the permisions on this scrip to be executable by
your Apache daemon's user and to place the code in a place where Apache is
willing to execute it. Now view the script in a browser. Take not of the PID
and time (or lack thereof), and reload. Do this 10-20 times and you'll see
mod_perl magic (or toe stubbing, deppending on how you look at it.)

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu