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

mod_perl and Apache::Registry (code)

by deprecated (Priest)
on Nov 14, 2001 at 00:07 UTC ( #125132=perlquestion: print w/replies, xml ) Need Help??
deprecated has asked for the wisdom of the Perl Monks concerning the following question:

I'm having a problem with a perl script on an apache server using mod_perl. This is a mostly default mandrake 8.1 install, but I know my way around apache configs.

This is a very _old_ server, and it literally takes 21% of the cpu to launch this cgi. It takes a few (maybe 5) seconds to actually display to the browser. However, it takes less than one second if i rename 'index.cgi' to ''. As I understand it, this is mod_perl working for me. Now, a friend told me I could use Apache::Registry to 'cache' the file in the server so that it would not have to re-read it every time (the pod seems to agree with this). So I tossed a use Apache::Registry in there, and let 'er rip.

First, the page displays right the first and only time I load it. then after that, it just spits out the source. If add '.pl' to the "add handler" section of the config file (after .cgi), it seems that mod_perl does not get to process it, and it reverts to being slow.

I do in fact have the

<IfModule mod_dir.c> DirectoryIndex index.html index.php index.php3 index.shtml index.c +gi index.htm Default.htm default.htm </IfModule>
directive in the config file. I suspect that it may have something to do with:
q(<meta http-equiv="refresh" CONTENT="10; URL= +/">),
and the caching of browsers and the like. Has anyone seen behaviour like this out of mod_perl? I'm rather new to it.

brother dep.

Laziness, Impatience, Hubris, and Generosity.

Replies are listed 'Best First'.
Re: mod_perl and Apache::Registry (code)
by perrin (Chancellor) on Nov 14, 2001 at 01:00 UTC
    Please post your httpd.conf. You don't need to use Apache::Registry in your code, just in httpd.conf or You also have to configure Apache::Regsirty as the handler for the files or directories with your scripts to run.
      Erm, my httpd.conf is split over at least four different files. Is there something in specific I should be looking for? I'm also not particularly comfortable a) pasting 700 lines of httpd.conf to perlmonks b) pasting my httpd.conf anywhere.


      Laziness, Impatience, Hubris, and Generosity.

        Just post the part where you set up Apache::Registry as a PerlHandler. If there is no such part, that's the problem.
Re: mod_perl and Apache::Registry (code)
by princepawn (Parson) on Nov 14, 2001 at 03:47 UTC
    Here is the relevant code from KM's and Brent Michalski's book: "Writing CGI Applications with Perl" <code> <Files *.rpl$> SetHandler perl-script Perlhandler Apache::Registry PerlSendHeader On Options +ExecCGI </Files>

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2017-10-22 05:51 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (272 votes). Check out past polls.