Server::Control::HTTPServerSimple - apachectl style control for


Server-Control documentation  | view source Contained in the Server-Control distribution.

Index


NAME

Top

Server::Control::HTTPServerSimple -- apachectl style control for HTTP::Server::Simple servers

VERSION

Top

version 0.15

SYNOPSIS

Top

    package My::Server;
    use base qw(HTTP::Server::Simple);
    sub net_server { 'Net::Server::PreForkSimple' }

    ---

    use Server::Control::HTTPServerSimple;
    my $ctl = Server::Control::HTTPServerSimple->new(
        server_class => 'My::Server',
        net_server_params => {
            pid_file => '/path/to/server.pid',
            port     => 5678,
            log_file => '/path/to/file.log'
        }
    );
    if ( !$ctl->is_running() ) {
        $ctl->start(...);
    }

DESCRIPTION

Top

Server::Control::HTTPServerSimple is a subclass of Server::Control for HTTP::Server::Simple servers.

CONSTRUCTOR

Top

The constructor options are as described in Server::Control, except for:

server_class

Required. Specifies a HTTP::Server::Simple subclass. Will be loaded if not already.

This subclass must specify a net_server class, because vanilla HTTP::Server::Simple does not create pid files.

net_server_params

Specifies a hashref of parameters to pass to the server's run() method.

pid_file

Will be taken from net_server_params.

port

Will be taken from net_server_params.

error_log

If not provided, will attempt to get from log_file key in net_server_params.

SEE ALSO

Top

Server::Control, HTTP::Server::Simple

COPYRIGHT AND LICENSE

Top


Server-Control documentation  | view source Contained in the Server-Control distribution.