An active-active Apache HTTPD cluster runs the web service on multiple nodes at the same time so traffic can be shared and a single node outage does not take the site offline.
A Pacemaker + Corosync cluster managed with the pcs CLI can control Apache HTTPD as a systemd resource and clone it so one instance runs per node. The cluster continuously monitors each instance and recovers failed services, while routing is handled separately by a load balancer or DNS.
Configuration files, enabled modules, and web content must match on every node because requests can land on any server at any time. Disable standalone service enablement so systemd does not start Apache HTTPD outside of cluster control, and plan session storage, TLS termination, and health checks before distributing production traffic.
Steps to set up Apache HTTPD active-active with PCS:
- Confirm the cluster is online and has quorum.
$ sudo pcs status Cluster name: clustername Cluster Summary: * Stack: corosync (Pacemaker is running) * Current DC: node-01 (version 2.1.6-6fdc9deea29) - partition with quorum * Last updated: Thu Jan 1 00:49:38 2026 on node-01 ##### snipped #####
- Identify the Apache HTTPD service unit name.
$ systemctl list-unit-files --type=service | grep -E '^(apache2|httpd)\.service' apache2.service disabled enabled
The unit name is referenced in pcs as systemd:httpd or systemd:apache2.
- Validate the Apache HTTPD configuration on each cluster node.
$ sudo apachectl configtest Syntax OK
Use apache2ctl configtest when apachectl is not present.
- Disable the standalone Apache HTTPD service in systemd.
$ sudo systemctl disable --now apache2 Synchronizing state of apache2.service with SysV service script with /usr/lib/systemd/systemd-sysv-install. Executing: /usr/lib/systemd/systemd-sysv-install disable apache2 Synchronizing state of apache2.service with SysV service script with /usr/lib/systemd/systemd-sysv-install. Executing: /usr/lib/systemd/systemd-sysv-install disable apache2 Synchronizing state of apache2.service with SysV service script with /usr/lib/systemd/systemd-sysv-install. Executing: /usr/lib/systemd/systemd-sysv-install disable apache2
Apache HTTPD stops immediately on that node until the cloned cluster resource is started.
- Create the Apache HTTPD service resource.
$ sudo pcs resource create apache_service systemd:apache2 op monitor interval=30s
Run pcs configuration changes on a single cluster node only.
Use systemd:apache2 when that unit is present.
Related: How to create a Pacemaker resource
- Clone the Apache HTTPD service resource across nodes.
$ sudo pcs resource clone apache_service
A clone starts one instance per eligible node by default.
- Verify the cloned resource status.
$ sudo pcs status resources * Clone Set: dummy-check-clone [dummy-check]: * Started: [ node-01 node-02 node-03 ] ##### snipped ##### * Clone Set: apache_service-clone [apache_service]: * Started: [ node-01 node-02 node-03 ] - Send a test request to each node to confirm Apache HTTPD is serving traffic.
$ curl -sI http://192.0.2.11/ HTTP/1.1 200 OK Date: Thu, 01 Jan 2026 00:49:46 GMT Server: Apache/2.4.58 (Ubuntu) Last-Modified: Thu, 01 Jan 2026 00:28:55 GMT ETag: "3-64748ad945d38" Accept-Ranges: bytes Content-Length: 3 Content-Type: text/html $ curl -sI http://192.0.2.12/ HTTP/1.1 200 OK Date: Thu, 01 Jan 2026 00:49:46 GMT Server: Apache/2.4.58 (Ubuntu) Last-Modified: Thu, 01 Jan 2026 00:28:59 GMT ETag: "3-64748adcb6328" Accept-Ranges: bytes Content-Length: 3 Content-Type: text/html
- Update client routing to distribute traffic across active nodes.
Use a load balancer or DNS records that include every active node address, and configure health checks to remove failed nodes from rotation.
- Run a failover test with traffic distribution in place.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
