#!/usr/bin/perl
use strict;
use warnings;
use Server::Control::Apache;

Server::Control::Apache->handle_cli();



=pod

=head1 NAME

apachectlp - a more featureful Perl-based replacement for apachectl

=head1 VERSION

version 0.20

=head1 SYNOPSIS

   apachectlp [-f conf_file] [-d server_root] [-b httpd_binary] [-v]
              -k start|stop|restart|ping|graceful|graceful-stop
   apachectlp -h

=head1 DESCRIPTION

C<apachectlp> uses L<Server::Control::Apache|Server::Control::Apache> to start,
stop, restart or ping (show status of) an Apache httpd server.

Features:

=over

=item *

Checks server status both by looking at the pid file, and by contacting the
server's port

=item *

Tails the error log when server fails to start

=item *

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

=item *

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

=back

=head1 OPTIONS

Required options: -k, and either -d or -f.

 -b, --httpd-binary  Specify an httpd binary - defaults to the first httpd in user's PATH
 -c, --class         Specify a customized class to use instead of Server::Control::Apache
 -d, --server-root   Specify the server root - will determine from configuration file if given
 -f, --conf-file     Specify the httpd conf file - defaults to conf/httpd.conf under server root
 -h, --help          Print help message
 -k, --action        Specify action - start, stop, restart, or ping
 -q, --quiet         Show only errors and warnings
 -v, --verbose       Show verbose output
 -I                  Library paths to include

C<Server::Control::Apache> needs the values below and usually gets them by
parsing the Apache configuration file, but you may pass any of them if the
parsing isn't working.

 --bind-addr
 --error-log
 --pid-file
 --port
 --use-sudo

And in general, any constructor parameter to L<Server::Control|Server::Control>
or C<Server::Control::Apache> can be passed here (replacing underscores with
dashes), e.g.

 --name
 --wait-for-status-secs

=head1 RC FILE

You may place options in an rc file called serverctl.yml in the server root,
e.g.

    # This is my serverctl.yml
    use_sudo: 1
    wait_for_status_secs: 5

You can also specify the path of the rc file with --serverctlrc.

=head1 AUTHOR

Jonathan Swartz

=head1 SEE ALSO

apachectl, httpd, L<Server::Control::Apache|Server::Control::Apache>

=head1 COPYRIGHT & LICENSE

Copyright (C) 2007 Jonathan Swartz.

This software 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.

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Jonathan Swartz.

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

=cut


__END__