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 the httpd binary. Optional, lowkey. (optional, string, default "/usr/sbin/httpd")
  • port β€” A port number that we can probe for status info using the statusurl. It defaults to the port number found in the configuration file, or 80 if 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 of statusurl. 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. Currently wget and curl are 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 of testurl. 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. See man 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 (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). 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 πŸ“


πŸ‘‘ 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