Server::Control::Apache - Control Apache ala apachtctl


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

Index


NAME

Top

Server::Control::Apache -- Control Apache ala apachtctl

VERSION

Top

version 0.15

SYNOPSIS

Top

    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();
    }

DESCRIPTION

Top

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.

CONSTRUCTOR

Top

In addition to the constructor options described in Server::Control:

conf_file

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.

httpd_binary

Path to httpd binary. By default, searches for httpd in the user's PATH and uses the first one found.

no_parse_config

Don't attempt to parse the httpd.conf; only look at values passed in the usual ways.

validate_url

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.

validate_regex

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.

METHODS

Top

The following methods are supported in addition to those described in Server::Control:

graceful

Gracefully restart the server - see http://httpd.apache.org/docs/2.2/stopping.html

graceful-stop

Gracefully stop the server - see http://httpd.apache.org/docs/2.2/stopping.html

TO DO

Top

SEE ALSO

Top

apachectlp (apachectlp), Server::Control

COPYRIGHT AND LICENSE

Top


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