Your company here ā€” click to reach over 10,000 unique daily visitors

ocf_heartbeat_apache - Man Page

Manages an Apache Web server instance


apache [start | stop | status | monitor | meta-data | validate-all]


This is the resource agent for the Apache Web server. This resource agent operates both version 1.x and version 2.x Apache servers.

The start operation ends with a loop in which monitor is repeatedly called to make sure that the server started and that it is operational. Hence, if the monitor operation does not succeed within the start operation timeout, the apache resource will end with an error status.

The monitor operation by default loads the server status page which depends on the mod_status module and the corresponding configuration file (usually /etc/apache2/mod_status.conf). Make sure that the server status page works and that the access is allowed *only* from localhost (address See the statusurl and testregex attributes for more details.

See also http://httpd.apache.org/

Supported Parameters


The full pathname of the Apache configuration file. This file is parsed to provide defaults for various other resource agent parameters.

(unique, optional, string, default "/etc/httpd/conf/httpd.conf")


The full pathname of the httpd binary (optional).

(optional, string, default "/usr/sbin/httpd")


A port number that we can probe for status information using the statusurl. This will default to the port number found in the configuration file, or 80, if none can be found in the configuration file.

(optional, integer, no default)


The URL to monitor (the apache server status page by default). If left unspecified, it will be inferred from the apache configuration file.

If you set this, make sure that it succeeds *only* from the localhost ( Otherwise, it may happen that the cluster complains about the resource being active on multiple nodes.

(optional, string, no default)


Regular expression to match in the output of statusurl. Case insensitive.

(optional, string, default "exists, but impossible to show in a human readable format (try grep testregex)")


Client to use to query to Apache. If not specified, the RA will try to find one on the system. Currently, wget and curl are supported. For example, you can set this parameter to "curl" if you prefer that to wget.

(optional, string, no default)


URL to test. If it does not start with "http", then it's considered to be relative to the Listen address.

(optional, string, no default)


Regular expression to match in the output of testurl. Case insensitive.

(optional, string, no default)


A file which contains test configuration. Could be useful if you have to check more than one web application or in case sensitive info should be passed as arguments (passwords). Furthermore, using a config file is the only way to specify certain parameters.

Please see README.webapps for examples and file description.

(optional, string, no default)


Name of the test within the test configuration file.

(optional, string, no default)


Extra options to apply when starting apache. See man httpd(8).

(optional, string, no default)


Files (one or more) which contain extra environment variables. If you want to prevent script from reading the default file, set this parameter to empty string.

(optional, string, default "/etc/apache2/envvars")


We will try to detect if the URL (for monitor) is IPv6, but if that doesn't work set this to true to enforce IPv6.

(optional, boolean, default false)

Supported Actions

This resource agent supports the following actions (operations):


Starts the resource. Suggested minimum timeout: 40s.


Stops the resource. Suggested minimum timeout: 60s.


Performs a status check. Suggested minimum timeout: 30s.


Performs a detailed status check. Suggested minimum timeout: 20s. Suggested interval: 10s.


Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s.


Performs a validation of the resource configuration. Suggested minimum timeout: 5s.

Example CRM Shell

The following is an example configuration for a apache resource using the crm(8) shell:

primitive p_apache ocf:heartbeat:apache \
  op monitor depth="0" timeout="20s" interval="10s"

Example PCS

The following is an example configuration for a apache resource using pcs(8)

pcs resource create p_apache ocf:heartbeat:apache \
  op monitor OCF_CHECK_LEVEL="0" timeout="20s" interval="10s"

See Also



ClusterLabs contributors (see the resource agent source for information about individual authors)


04/26/2024 resource-agents UNKNOWN OCF resource agents