Gepok

 view release on metacpan or  search on metacpan

lib/Gepok.pm  view on Meta::CPAN

(which will be passed to IO::Socket).

=head2 require_root => BOOL (default 0)

Whether to require running as root.

Passed to Proc::Daemon::Prefork's constructor.

=head2 pid_path => STR (default /var/run/<name>.pid or ~/<name>.pid)

Location of PID file.

=head2 scoreboard_path => STR (default /var/run/<name>.scoreboard or ~/<name>.scoreboard)

Location of scoreboard file (used for communication between parent and child
processes). If you disable this, autoadjusting number of children won't work
(number of children will be kept at 'start_servers').

=head2 error_log_path => STR (default /var/log/<name>-error.log or ~/<name>-error.log)

Location of error log. Default is /var/log/<name>-error.log. It will be opened
in append mode.

=head2 access_log_path => STR (default /var/log/<name>-access.log or ~/<name>-access.log)

Location of access log. It will be opened in append mode.

Default format of access log is the Apache combined format. Override
access_log() method if you wan't to customize this.

If Gepok is run Under plackup, by default it will not write an access log file
(unless you specify this attribute) since plackup already writes an access log.

=head2 ssl_key_file => STR

Path to SSL key file, to be passed to HTTP::Daemon::SSL. If you specify one or
more HTTPS ports, you need to supply this.

=head2 ssl_cert_file => STR

Path to SSL cert file, to be passed to HTTP::Daemon::SSL. If you specify one or
more HTTPS ports, you need to supply this.

=head2 ssl_verify_mode => INT

Level of verification for SSL client certificates, to be passed to
HTTP::Daemon::SSL. This is optional.

=head2 ssl_verify_callback => CODEREF

Custom verifier for SSL client certificates, to be passed to HTTP::Daemon::SSL.
This is optional.

=head2 ssl_ca_file => STR

Path for file containing certificates of reputable authorties for certificate
verification. This is optional.

=head2 ssl_ca_path => STR

According to L<IO::Socket::SSL> this is only of interest if you are
"unusually friendly with the OpenSSL documentation". This is optional.

=head2 start_servers => INT (default 3)

Number of children to fork at the start of run. If you set this to 0, the server
becomes a nonforking one.

Tip: You can set start_servers to 0 and 'daemonize' to false for debugging.

=head2 max_clients => INT (default 150)

Maximum number of children processes to maintain. If server is busy, number of
children will be increased from the original 'start_servers' up until this
value.

=head2 max_requests_per_child => INT (default 1000)

Number of requests each child will serve until it exists.

=head2 product_name => STR

Used in 'Server' HTTP response header (<product_name>/<version>). Defaults to
class name, e.g. "Gepok".

=head2 product_version => STR

Used in 'Server' HTTP response header (<product_name>/<version>). Defaults to
$VERSION package variable.

=head1 METHODS

=for Pod::Coverage BUILD

=head2 new(%args)

Create a new instance of server. %args can be used to set attributes.

=head2 $gepok->run($app)

Start/run server and run the PSGI application $app.

=head2 $gepok->start($app)

Alias for run().

=head2 $gepok->stop()

Stop running server.

=head2 $gepok->restart()

Restart server.

=head2 $gepok->is_running() => BOOL

Check whether server is running.

=head2 $gepok->before_prefork()

This is a hook provided for subclasses to do something before the daemon is



( run in 2.732 seconds using v1.01-cache-2.11-cpan-d8267643d1d )