Jonathan Swartz


apachectlp - a more featureful Perl-based replacement for apachectl


version 0.20


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


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


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

  • Tails the error log when server fails to start

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

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


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

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.


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



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.


Jonathan Swartz


apachectl, httpd, Server::Control::Apache


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.


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.