Forum Moderators: coopster & phranque

Message Too Old, No Replies

CGI and mod_perl

Can you run CGI perl scripts and mod_perl

         

PhraSEOlogy

2:56 am on Apr 14, 2004 (gmt 0)

10+ Year Member



I have been trying to find out if I can run mod_perl and CGI perl scripts at the same time.

I want to use html::mason under mod_perl but want all my CGI scripts to run as usual. I know that they will run faster under mod_perl but they would have to be "improved" as the code is not very "mod_perlish".

Is there a directive to tell apache to run scripts in one directory as mod_perl and run all others as CGI scripts?

SeanW

2:44 am on Apr 15, 2004 (gmt 0)

10+ Year Member



Yes, continue with your ScriptAlias for the cgi directory, and make sure there aren't any handlers configured for it. Use something like /perl for the mod_perl stuff.

Note that there is both Apache::Registry and Apache::PerlRun. The former keeps your program resident in memory, the latter only keeps the interpreter in memory but reinterprets the script on each hit. You'll save the expense of the fork() for perl, at least.

BTW, if your code runs under "use strict" it'll be fine under Apache::Registry.

Sean

PhraSEOlogy

12:33 pm on Apr 18, 2004 (gmt 0)

10+ Year Member



THanks for the reply SeanW.

I am still having problems just trying to get this stuff running.

Mason looks like a really neat module but I cant get it to work on my server. I cant get it to work in CGI mode either.

I use plenty of perl modules and have no problem with those. Perhaps I need to dig into the murky depths of apache and mod_perl to "understand" what I am doing.

Storyteller

11:38 am on Apr 20, 2004 (gmt 0)

10+ Year Member



I use Mason on a daily basis. If you describe your problem in more detail, I might be able to help. Or better, write to Mason-Users mailing list - people there are very friendly and helpful.

martin

2:05 pm on Apr 26, 2004 (gmt 0)

10+ Year Member



Try SpeedyCGI, it's not as strict as mod_perl but is still faster than CGI.