FCGI-Spawn
view release on metacpan or search on metacpan
bin/fcgi_spawn view on Meta::CPAN
} qw/webguiRoot bugzillaRoot skybillRoot/;
=back
All of the preload scripts, if any exist, are eval()'ed after the C<$spawn> is initialized with the values from:
=head2 Configuration File
C<fcgi_spawn.conf>, to be read from the configuration directory specified with C<-c> command line parameter, should contain the values of the L<FCGI::Spawn|FCGI::Spawn> object constructor, method "L<new|FCGI::Spawn/new>", if those need to differ from...
Syntax is: spaces and tabs at the begin of the line are ignored, the C<#> symbol before the rest means this line is ignored as a comment too, key and value are separated with the space(s) or tab(s) all on the same line, and if the value is multiple (...
Sample configuration file, C<fcgi_spawn.conf.sample>, is provided in the source distribution.
=head1 Typical CGI Applications with C<fcgi_spawn>
C<FCGI::Spawn>, and therefore C<fcgi_spawn>, are able to work in Unix and Cygwin environments, with 'properly' written CGI applications, which the most of the well-known CGI applications are. This means: no much assign of the global variables, incaps...
Care should be taken about file and database handles closing and networking sockets disconnection because the C<END{}> block of your Perl application is unlikely to be executed automatically, like it does in true CGI application. You should refer to ...
=head2 WebGUI.org
fcgi_spawn.conf.sample view on Meta::CPAN
n_processes 5
sock_chown -1 20020
clean_inc_subnamespace Bugzilla::Config
# clean_inc_hash 2
sock_chmod 0660
max_requests 50
stats 1
lib/FCGI/Spawn.pm view on Meta::CPAN
=head1 SYNOPSIS
Minimum unrecommended way to illustrate it working:
FCGI::Spawn->new->spawn;
Never put this in production use. The C<fcgi_spawn> script supplied should care about sadly mandatory whistles and bells, at least the security is a king in sight of this:
FCGI::Spawn code should be run as its own user id, and the web server should be configured to request its FastCGI; in the case the local socket file is used, the web server should have the read and write permissions on it, the default name is /tmp/sp...
Consider about sock_chmod/sock_chown parameters for this, too.
In the case if you request via TCP care should be taken on network security like DMZ/VPN/firewalls setup instead of sock_* parameters.
About the ready to run applications compatibility refer to C<fcgi_spawn> docs.
Every other thing is explained in L<FCGI::ProcManager|FCGI::ProcManager> docs.
=head1 DESCRIPTION
lib/FCGI/Spawn.pm view on Meta::CPAN
Be sure to have L<FCGI::ProcManager|FCGI::ProcManager>.
=head1 METHODS
=head2 new({hash parameters})
Class method.
Constructs a new process manager.
Takes an option hash of the sock_name and sock_chown initial parameter values, and passes the entire hash rest to ProcManager's constructor.
The parameters are:
=over
=item * $ENV{FCGI_SOCKET_PATH}
Not a hash parameter but the enironment variable.
Should be set before module compilation, to know where the socket resides.
Can be in the host:port or even :port notation for TCP, as FCGI.pm's remote.fpl states.
Default: /tmp/spawner.sock.
You can set environment value with your shell like this:
FCGI_SOCKET_PATH=/var/lib/fcgi.sock ./fcgi_spawn.pl <parameters>
or you can enclose it into the eval() like that:
$ENV{FCGI_SOCKET_PATH} = '/var/lib/fcgi.sock';
eval( "use FCGI::Spawn;" ); die $@ if $@;
=item * sock_chown
is the array reference which sets the parameters for chown() builtin on newly created socket, when needed.
Default: none.
=item * readchunk
is the buffer size for user's source reading in plsrc function.
Deprecated and will be removed in future versions.
Default: 4096.
=item * maxlength
lib/FCGI/Spawn.pm view on Meta::CPAN
my $class = shift;
my ( $new_properties, $properties );
if ( $properties = shift ) {
$properties = { %$defaults, %$properties };
}
else {
$properties = $defaults;
}
my $proc_manager = FCGI::ProcManager->new($properties);
my $sock_name = $ENV{FCGI_SOCKET_PATH};
if ( defined $properties->{sock_chown} ) {
chown( @{ $properties->{sock_chown} }, $sock_name )
or die $!;
}
if ( defined $properties->{sock_chmod} ) {
chmod( $properties->{sock_chmod}, $sock_name )
or die $!;
}
defined $properties->{readchunk}
and $readchunk = $properties->{readchunk};
defined $properties->{maxlength}
and $maxlength = $properties->{maxlength};
( run in 0.695 second using v1.01-cache-2.11-cpan-71847e10f99 )