NAME
    Server::Control -- Flexible apachectl style control for servers

SYNOPSIS
        use Server::Control::Apache;

        my $apache = Server::Control::Apache->new(
            conf_file => '/my/apache/dir/conf/httpd.conf'
        );
        if ( !$apache->is_running() ) {
            $apache->start();
        }

DESCRIPTION
    `Server::Control' allows you to control servers in the spirit of
    apachectl, where a server is any background process which listens to a
    port and has a pid file. It is designed to be subclassed for different
    types of servers.

FEATURES
    *   Checks server status in multiple ways (looking for an active
        process, contacting the server's port)

    *   Detects and handles corrupt or out-of-date pid files

    *   Tails the error log when server fails to start

    *   Uses sudo by default when using restricted (< 1024) port

    *   With Unix::Lsof installed, reports what is listening to a port when
        it is busy

AVAILABLE SUBCLASSES
    The following subclasses are currently available as part of this
    distribution:

    *   Server::Control::Apache - Apache httpd

    *   Server::Control::HTTPServerSimple - HTTP::Server::Simple server

    *   Server::Control::NetServer - Net::Server server

    These will probably be moved into their own distributions once the
    implementation stabilizes.

RELATED MODULES
    *   App::Control - Same basic idea for any application with a pid file.
        No features specific to a server listening on a port, and not easily
        subclassable, as all commands are handled in a single case
        statement.

    *   MooseX::Control - A Moose role for controlling applications with a
        pid file. Nice extendability. No features specific to a server
        listening on a port, and assumes server starts via a command-line
        (unlike pure-Perl servers, say). May end up using this role.

    *   Nginx::Control, Sphinx::Control, Lighttpd::Control - Modules which
        use MooseX::Control

TO DO
    *   Add 'refork' action, which kills all children of a forking server

    *   Write a plugin to dynamically generate conf files

ACKNOWLEDGMENTS
    This module was developed for the Digital Media group of the Hearst
    Corporation, a diversified media company based in New York City. Many
    thanks to Hearst management for agreeing to this open source release.

AUTHOR
    Jonathan Swartz

COPYRIGHT & LICENSE
    Copyright (C) 2007 Jonathan Swartz, all rights reserved.

    Server::Control is provided "as is" and without any express or implied
    warranties, including, without limitation, the implied warranties of
    merchantibility and fitness for a particular purpose.

    This program is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

