Perl & mod_fcgid- how can I be sure it's working?
Asked Answered
G

1

5

I have a couple Perl scripts I'm taking public soon, and I want to make sure they'll run under mod_fcgid in order to keep the server load as low as possible. Previously, I've only ever run scripts that test FastCGI (ie, while ( my $q = new CGI::Fast ) { $count++; echo $count;}) or taken advantage of larger Perl packages (like MovableType) that claim to run as FCGI as long as you set up Apache & FastCGI/mod_fcgid properly and change the file suffix to ".fcgi".

So, here's my question: do I need to do anything besides change the file suffix of my scripts, and if so, what?

Gaelan answered 14/10, 2008 at 20:2 Comment(0)
N
3

You'll need to install FastCGI and configure your Apache to use it, but I assume you knew that. To test if your code is in fact running under FCGI instead of regular CGI, you can use the IsFastCGI method from the FCGI request object, which CGI::Fast uses under the hood.

use FCGI;

my $request = FCGI::Request();
if ( $request->IsFastCGI ) { 
    print "we're running under FastCGI!";
} else { 
    print "plain old boring CGI";
}
Nous answered 15/10, 2008 at 1:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.