Perl & mod_fcgid- how can I be sure that it works?

I have several Perl scripts that I am publishing soon, and I want to make sure that they work in mod fcgid mode so that the server loads as little as possible. I used to just run scripts that tested FastCGI (i.e. while (my $ q = new CGI :: Fast) {$ count ++; echo $ count;}) or used larger Perl packages (like MovableType), which claim to run as FCGI until you have correctly configured Apache and FastCGI / mod fcgid and change the file suffix to ".fcgi".

So, here is my question: do I need to do something other than change the suffix of my script file, and if so, then what?

+4
source share
1 answer

You will need to install FastCGI and configure Apache to use it, but I assume you knew that. To check if your code really works under FCGI instead of regular CGI, you can use the IsFastCGI method from the FCGI request object that CGI :: Fast uses under the hood.

 my $request = FCGI::Request(); if ( $request->IsFastCGI ) { print "we're running under FastCGI!"; } else { print "plain old boring CGI"; } 
+2
source

Source: https://habr.com/ru/post/1277746/


All Articles