| Server-Control documentation | view source | Contained in the Server-Control distribution. |
Server::Control::Apache -- Control Apache ala apachtctl
version 0.15
use Server::Control::Apache;
my $apache = Server::Control::Apache->new(
server_root => '/my/apache/dir'
# OR
conf_file => '/my/apache/dir/conf/httpd.conf'
);
if ( !$apache->is_running() ) {
$apache->start();
}
Server::Control::Apache is a subclass of Server::Control for Apache httpd processes. It has the same basic function as apachectl, only with a richer feature set.
This module has an associated binary, apachectlp (apachectlp), which you may want to use instead.
In addition to the constructor options described in Server::Control:
Path to conf file. Will try to use
server_root in Server::Control/conf/httpd.conf if server_root was specified
and conf_file was not. Throws an error if it cannot be determined.
Path to httpd binary. By default, searches for httpd in the user's PATH and uses the first one found.
Don't attempt to parse the httpd.conf; only look at values passed in the usual ways.
A URL to visit after the server has been started or HUP'd, in order to validate the state of the server. The URL just needs to return an OK result to be considered valid, unless validate_regex is also specified.
A regex to match against the content returned by validate_url. The content must match the regex for the server to be considered valid.
This module can usually determine bind_addr in Server::Control, error_log in Server::Control, pid_file in Server::Control, and port in Server::Control by parsing the conf file. However, if the parsing doesn't work or you wish to override certain values, you can pass them in manually.
The following methods are supported in addition to those described in Server::Control:
Gracefully restart the server - see http://httpd.apache.org/docs/2.2/stopping.html
Gracefully stop the server - see http://httpd.apache.org/docs/2.2/stopping.html
apachectlp (apachectlp), Server::Control
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.
| Server-Control documentation | view source | Contained in the Server-Control distribution. |