Configure Apache HTTP Server clustering with mod_cluster and JBoss EAP for enterprise load balancing

Advanced 45 min Apr 17, 2026 937 views
Ubuntu 24.04 Ubuntu 22.04 Debian 12 AlmaLinux 9 Rocky Linux 9 Fedora 41

Set up Apache HTTP Server with mod_cluster module to create an intelligent load balancing cluster with JBoss EAP application servers, featuring automatic node discovery, session clustering, and health monitoring.

Prerequisites

  • Root or sudo access
  • At least 4GB RAM
  • Java 11 or higher
  • Basic understanding of enterprise Java applications
  • Network connectivity between cluster nodes

What this solves

This tutorial shows how to configure Apache HTTP Server with the mod_cluster module to create an intelligent load balancing solution for JBoss EAP application servers. Unlike traditional load balancers, mod_cluster provides dynamic configuration, automatic node discovery, and context-aware routing based on real-time server metrics.

You'll learn to set up a complete clustering environment with session replication, automatic failover, and comprehensive health monitoring for enterprise Java applications.

Step-by-step installation

Update system packages

Start by updating your system to ensure you have the latest packages and security updates.

sudo apt update && sudo apt upgrade -y
sudo dnf update -y

Install Apache HTTP Server and development tools

Install Apache web server along with development tools needed for compiling mod_cluster from source.

sudo apt install -y apache2 apache2-dev gcc make curl wget unzip
sudo a2enmod ssl
sudo a2enmod headers
sudo a2enmod rewrite
sudo dnf install -y httpd httpd-devel gcc make curl wget unzip
sudo systemctl enable httpd

Download and compile mod_cluster

Download the latest mod_cluster source code and compile it for your Apache installation.

cd /tmp
wget https://github.com/modcluster/mod_cluster/releases/download/2.0.6.Final/mod_cluster-2.0.6.Final-linux-x86_64-ssl.tar.gz
tar -xzf mod_cluster-2.0.6.Final-linux-x86_64-ssl.tar.gz
cd mod_cluster-2.0.6.Final

Install mod_cluster modules

Copy the compiled mod_cluster modules to Apache's modules directory and set proper permissions.

sudo cp so/mod_proxy_cluster.so /usr/lib/apache2/modules/
sudo cp so/mod_cluster_slotmem.so /usr/lib/apache2/modules/
sudo cp so/mod_manager.so /usr/lib/apache2/modules/
sudo cp so/mod_advertise.so /usr/lib/apache2/modules/
sudo chown root:root /usr/lib/apache2/modules/mod_*.so
sudo chmod 644 /usr/lib/apache2/modules/mod_*.so
sudo cp so/mod_proxy_cluster.so /usr/lib64/httpd/modules/
sudo cp so/mod_cluster_slotmem.so /usr/lib64/httpd/modules/
sudo cp so/mod_manager.so /usr/lib64/httpd/modules/
sudo cp so/mod_advertise.so /usr/lib64/httpd/modules/
sudo chown root:root /usr/lib64/httpd/modules/mod_*.so
sudo chmod 644 /usr/lib64/httpd/modules/mod_*.so

Configure mod_cluster in Apache

Create the mod_cluster configuration file to define cluster behavior and load balancing parameters.

LoadModule cluster_slotmem_module modules/mod_cluster_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so
sudo a2enmod cluster
LoadModule cluster_slotmem_module modules/mod_cluster_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so

Create mod_cluster virtual host configuration

Configure a dedicated virtual host for mod_cluster management and load balancing operations.

sudo a2ensite mod-cluster
sudo a2dissite 000-default

Install JBoss EAP

Download and install JBoss EAP application server which will serve as cluster nodes.

cd /opt
sudo wget https://developers.redhat.com/download-manager/file/jboss-eap-8.0.0.zip
sudo unzip jboss-eap-8.0.0.zip
sudo mv jboss-eap-8.0 jboss-eap
sudo chown -R jboss:jboss /opt/jboss-eap

Create JBoss user and group

Create a dedicated system user for running JBoss EAP securely without root privileges.

sudo groupadd -r jboss
sudo useradd -r -g jboss -d /opt/jboss-eap -s /bin/bash jboss
sudo chown -R jboss:jboss /opt/jboss-eap

Configure JBoss EAP for clustering

Create a clustered configuration for JBoss EAP with mod_cluster connector enabled.


Automated install script

Run this to automate the entire setup

Prefere não gerir isto sozinho?

Gerimos a infraestrutura de empresas que dependem do tempo de atividade. Totalmente gerida, com um contacto fixo que conhece o seu ambiente.

Tem um contacto fixo que conhece o seu ambiente

Roterdão 13:02 · acessível por mensagem, sem formulário de tickets