use strict;
use base 'Catalyst::Engine::CGI';
-use FCGI;
+eval "use FCGI";
+die "Please install FCGI\n" if $@;
=head1 NAME
interrupted by Ctrl+C
nproc Specify a number of processes for
FCGI::ProcManager
+ pidfile Specify a filename for the pid file
=cut
}
$options ||= {};
-
+
my %env;
my $request =
my $proc_manager;
- if ( $listen and ( $options->{nproc} || 1 ) > 1 ) {
+ if ($listen) {
require FCGI::ProcManager;
+ $options->{nproc} ||= 1;
+
$proc_manager =
FCGI::ProcManager->new( { n_processes => $options->{nproc} } );
+
+ if ( $options->{pidfile} ) {
+ $proc_manager->pm_write_pid_file( $options->{pidfile} );
+ }
+
$proc_manager->pm_manage();
}
# Launch the FastCGI processes
FastCgiIpcDir /tmp
- FastCgiServer /var/www/MyApp/script/myapp_fastcgi.pl -idle_timeout 300 -processes 5
+ FastCgiServer /var/www/MyApp/script/myapp_fastcgi.pl -idle-timeout 300 -processes 5
<VirtualHost *>
ScriptAlias / /var/www/MyApp/script/myapp_fastcgi.pl/