OCF_HEARTBEAT_APACHE(7)
π ocf_heartbeat_apache β the Apache resource agent, explained by your fav Unix bestie π«Ά
okay so picture this: you've got a whole Apache Web server and you need your cluster to actually know what's going on with it. That's this page, bestie. It's ocf_heartbeat_apache(7) from the OCF resource agents manual collection, and it's lowkey iconic. Let's get into it β¨
πΈ NAME πΈ
ocf_heartbeat_apache β literally just manages an Apache Web server instance. That's the whole gig. Slay. π
π SYNOPSIS π
apache [start | stop | status | monitor | meta-data | validate-all]
That's the whole mood. Pick an action, run it, get results. Simple as that, no cap.
π¦ DESCRIPTION π¦
So this is the resource agent for the Apache Web server, and honestly? It's giving versatility, because it operates both version 1.x and version 2.x Apache servers. Vintage and modern, it does not care. π
Here's the tea on how start actually works: it doesn't just kick things off and dip. Nope. The start operation finishes with a loop where monitor is repeatedly called, just to make sure the server actually started and it's genuinely operational. So if monitor doesn't succeed within the start operation timeout, bestie, the apache resource ends with an error status. Not a vibe, but that's the deal. π
Now, monitor 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). So make sure the server status page works, and make sure access is allowed only from localhost (address 127.0.0.1). Seriously. This is one of those π¨ moments. Check out the statusurl and testregex attributes for more details on that.
Also, see also http://httpd.apache.org/ if you wanna learn more. β¨
β¨ SUPPORTED PARAMETERS β¨
Okay this is the big one, so buckle up. Every single one of these matters!
configfileβ The full pathname of the Apache configuration file, and it gets parsed to provide defaults for a bunch of the other resource agent parameters. (unique, optional, string, default"/etc/httpd/conf/httpd.conf")httpdβ The full pathname of thehttpdbinary. Optional, lowkey. (optional, string, default"/usr/sbin/httpd")portβ A port number that we can probe for status info using thestatusurl. It defaults to the port number found in the configuration file, or80if none can be found in there at all. (optional, integer, no default)statusurlβ The URL to monitor (it's the apache server status page by default). If you leave it unspecified, it gets inferred from the apache configuration file.
π¨ But listen: if you set this, make sure it succeeds only from the localhost (127.0.0.1). Otherwise the cluster might start complaining that the resource is active on multiple nodes, and that's a whole mess you do not want. (optional, string, no default)
testregexβ A regular expression to match in the output ofstatusurl. Case insensitive, cute. (optional, string, default"exists, but impossible to show in a human readable format (try grep testregex)")clientβ The client to use to query Apache. If you don't specify it, the RA will try to find one on the system for you. Currentlywgetandcurlare supported. So like, you can set this parameter to"curl"if you prefer that over wget. Pick your fighter π (optional, string, no default)testurlβ URL to test. If it doesn't start with"http", then it's considered relative to the Listen address. (optional, string, no default)testregex10β A regular expression to match in the output oftesturl. Case insensitive. (optional, string, no default)testconffileβ A file which contains test configuration. Super useful if you gotta check more than one web application, or if case-sensitive info should be passed as arguments (like passwords π). And ngl, using a config file is the only way to specify certain parameters.
Please see README.webapps for examples and the file description. (optional, string, no default)
testnameβ The name of the test within the test configuration file. (optional, string, no default)optionsβ Extra options to apply when starting apache. Seeman httpd(8)for the deets. (optional, string, no default)envfilesβ Files (one or more!) which contain extra environment variables. If you want to prevent the script from reading the default file, just set this parameter to an empty string. (optional, string, default"/etc/apache2/envvars")use_ipv6β We'll try to detect if the URL (formonitor) is IPv6, but if that doesn't work, set this totrueto enforce IPv6. (optional, boolean, defaultfalse)
π SUPPORTED ACTIONS π
This resource agent supports the following actions (operations). Keep an eye on those timeouts, bestie:
startβ Starts the resource. Suggested minimum timeout:40s.stopβ Stops the resource. Suggested minimum timeout:60s.statusβ Performs a status check. Suggested minimum timeout:30s.monitorβ Performs a detailed status check. Suggested minimum timeout:20s. Suggested interval:10s.meta-dataβ Retrieves resource agent metadata (internal use only π). Suggested minimum timeout:5s.validate-allβ Performs a validation of the resource configuration. Suggested minimum timeout:5s.
π EXAMPLE CRM SHELL π
Here's an example config for an apache resource using the crm(8) shell. Look at her go:
primitive p_apache ocf:heartbeat:apache \
op monitor depth="0" timeout="20s" interval="10s"
β EXAMPLE PCS β
And here's the same energy for pcs(8), if that's more your thing:
pcs resource create p_apache ocf:heartbeat:apache \
op monitor OCF_CHECK_LEVEL="0" timeout="20s" interval="10s"
π SEE ALSO π
http://clusterlabs.org/β go peek, it's worth it π«Ά
π AUTHOR π
ClusterLabs contributors β see the resource agent source for info about the individual authors. Shoutout to all of them, fr fr. π
and that's the whole page, bestie!! β¨ This lil' rewrite came from resource-agents UNKNOWN, dated 10/01/2026, in the OCF_HEARTBEAT_APACHE(7) manual. Go forth and cluster responsibly π
π
π¦ where this page comes from
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms