Gepok

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


  require_root => BOOL (default 0)
    Whether to require running as root.

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

  pid_path => STR (default /var/run/<name>.pid or ~/<name>.pid)
    Location of PID file.

  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').

  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.

  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.

  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.

  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.

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

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

  ssl_ca_file => STR
    Path for file containing certificates of reputable authorties for
    certificate verification. This is optional.

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

  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.

  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.

  max_requests_per_child => INT (default 1000)
    Number of requests each child will serve until it exists.

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

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

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

  $gepok->run($app)
    Start/run server and run the PSGI application $app.

  $gepok->start($app)
    Alias for run().

  $gepok->stop()
    Stop running server.

  $gepok->restart()
    Restart server.

  $gepok->is_running() => BOOL
    Check whether server is running.

  $gepok->before_prefork()
    This is a hook provided for subclasses to do something before the daemon
    is preforking. For example, you can preload Perl modules here so that
    each child doesn't have to load modules separately (= inefficient).

  $gepok->access_log($req, $res, $sock)
    The default implementation uses the Apache combined format. Override if
    you want custom format. $res is HTTP::Request object, $res is PSGI
    response, $sock is the raw socket.

FAQ
  Why the name Gepok?
    Gepok is an Indonesian word, meaning bundle/bunch. This class bundles
    one or several HTTP::Daemon::* objects to create a stand-alone web
    server.

  Why use Gepok?
    The main feature for Gepok is builtin HTTPS support, which means you do
    not have to setup a separate front-end HTTPS proxy for serving content
    over HTTPS. This is convenient, especially for development. Builtin
    HTTPS support also makes some things easier to, e.g. check client
    certificates you can use the ssl_verify_callback options. Your PSGI
    application also has direct access to the raw socket
    ("$env->{'gepok.socket'}").

    However, for heavy traffic use, you might want to check out more
    battle-tested solution like Perlbal.



( run in 1.825 second using v1.01-cache-2.11-cpan-98e64b0badf )