Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

mod_perl question

by peppiv (Curate)
on Jul 22, 2002 at 14:17 UTC ( #184058=perlquestion: print w/ replies, xml ) Need Help??
peppiv has asked for the wisdom of the Perl Monks concerning the following question:

I am running Linux/Apache with mod_perl 1.26. Well, I'm not actually running mod_perl yet. I've been to perl.apache.org and it taught me a great deal. I'm ready to take the next leap but as I understand it, I have to change this:

Alias /perl/ /home/stas/modperl/ PerlModule Apache::PerlRun <Location /perl/> SetHandler perl-script PerlHandler Apache::PerlRun Options ExecCGI PerlSendHeader On allow from all </Location>

I've copied my perl scripts to the new directory but I'm hesitant to push the 'button'. I don't have a development box - this is our 'In house' web server! Is there anyway to test one or two scripts with mod_perl before I take the complete leap?

Every scripts has been written under the strict pragma so as I understand it they should work ok.

Anyone have any thoughts on this?

peppiv

Hey, I've been able to talk our company into being our own web host -> dedicated T1, apache/linux and I write every application in Perl! Score one more for us!

Comment on mod_perl question
Download Code
Re: mod_perl question
by rdfield (Priest) on Jul 22, 2002 at 14:36 UTC
    There should be a file called "printenv.pl" in your cgi-bin directory. Just amend the settings for your cgi-bin location to use PerlRun or Registry. A reasonable output page should result (and it will also confirm that you're using mod_perl). Next would be to copy a couple of standalone stripts that you've written into the directory...and see how they go.

    rdfield

Re: mod_perl question
by simeon2000 (Monk) on Jul 22, 2002 at 14:37 UTC
    I think you're safe with that setup. Unless you're particularly worried about mod_perl crashing apache. Assuming you use /cgi-bin for your current production directory, mod_perl won't touch your production code. Only scripts put in the /perl directory will invoke mod_perl.

    At a later time you may decide to make mod_perl handle ALL *.pl|cgi scripts, but with THAT setup only files in /perl will be mod_perl'd.

    "Falling in love with map, one block at a time." - simeon2000

Re: mod_perl question
by perrin (Chancellor) on Jul 22, 2002 at 15:34 UTC
    Don't play games with your live server. It's easy to start a testing server on a separate port like 8080 and play with mod_perl there. This too is covered in the docs at perl.apache.org.

    Despite attempts to handle as broad a range of scripts as possible, Apache::PerlRun is still just a compatibility layer. There are plenty of things you could do in your code that will work fine under CGI but fail with PerlRun.

Re: mod_perl question
by Cine (Friar) on Jul 22, 2002 at 17:19 UTC
    As you say yourself, they should work. However there is nothing stopping you from using mod_perl while still using your scripts as plain CGI scripts. You then have time to test each script running under mod_perl and CGI to see if there are any regressions. Even using strict it is my observation that some variables are not always reset when the script is continually running, and thus you should either change your script or use Apache::PerlRun instead.

    T I M T O W T D I
Re: mod_perl question
by Felonious (Chaplain) on Jul 23, 2002 at 04:41 UTC
    Is there anyway to test one or two scripts with mod_perl before I take the complete leap?

    Can't test it to verify at the moment, but maybe this is what your looking for:

    <Files test_script.pl> SetHandler perl-script PerlHandler Apache::PerlRun Options ExecCGI PerlSendHeader On allow from all </File>
    -- O thievish Night, Why should'st thou, but for some felonious end, In thy dark lantern thus close up the stars? --Milton

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://184058]
Approved by broquaint
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2014-09-20 05:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (153 votes), past polls