You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by My Alias <my...@yahoo.com> on 2000/06/24 18:06:22 UTC

Footer.pm

So I typed in the Footer.pm 
 (Eagle Book, p. 92-93), 

added the "handler" scripts
  <Location /cgi-bin>
    SetHandler perl-script
    PerlHandler Apache::Footer
  </Location>

and restarted the server.

Now, what used to be sent out as html is sent out
looking like:

#!/usr/bin/perl -w
use strict;
blah,
blah,

------------

I'm using CGI.pm and Apache::Registry.
What did I miss?  
Thanks in advance.

-Brett

__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

Re: Footer.pm

Posted by "G.W. Haywood" <ge...@www.jubileegroup.co.uk>.
Hi there,

On Sat, 24 Jun 2000, My Alias wrote:

>   <Location /cgi-bin>
>     SetHandler perl-script
>     PerlHandler Apache::Footer
>   </Location>
> 
> and restarted the server.
> 
> Now, what used to be sent out as html is sent out
> looking like:
> 
> #!/usr/bin/perl -w
> use strict;
> blah,
> blah,
> 
> ------------
> 
> I'm using CGI.pm and Apache::Registry.
> What did I miss?  

I can't see anything about Apache::Registry in your message except the
bit where you claim to be using it.  Without seeing your entire Apache
configuration I'm not _sure_ you're doing this, but I think you are
trying to have your <Location cgi-bin> handled BOTH by mod_perl AND by
mod_cgi.  I don't think you really want that.  You want some other
Location such as <cgi-perl> for your mod_perl stuff, so you keep
cgi-bin for old CGI scripts and stuff like that.  To keep it clean, I
wouldn't even use Registry on things in there.

So for example for mod_perl stuff you might say:

Alias /perl/ /usr/local/apache/cgi-perl/
<Location /perl>
  SetHandler perl-script
  PerlHandler Apache::Footer
</Location>

and for Apache::Registry stuff:

Alias /registry/ /usr/local/apache/cgi-registry/
<Location /perl>
  SetHandler perl-script
  PerlHandler Apache::Registry
</Location>

The `Location' /perl/ doesn't really exist, it's just a URI that
triggers Apache to look for things in the directory (in this case)
/usr/local/apache/cgi-perl/.  Then when it's time to serve the content
Apache notices that there's a handler installed for that location, the
handler being mod_perl.  When it's handling requests for stuff to be
served from that location, mod_perl gets the instruction to call
Apache::Footer.  Apache::Footer just modifies the file and sends it on
its way.  Similarly for Registry (presumably what used to be your CGI)
scripts.  There's nothing wrong with the example in the Eagle Book.

73,
Ged.