Skip to content

Add system httpd support and native httpd CI job#8

Merged
marekkopecky merged 7 commits into
modcluster:mainfrom
honza-kasik:httpd-fix
Jun 2, 2026
Merged

Add system httpd support and native httpd CI job#8
marekkopecky merged 7 commits into
modcluster:mainfrom
honza-kasik:httpd-fix

Conversation

@honza-kasik

@honza-kasik honza-kasik commented Jun 1, 2026

Copy link
Copy Markdown
Contributor
  • System httpd support — NativeHttpdBalancer now supports system-installed httpd (-Dhttpd.home=/usr) alongside JBCS ZIP distributions. A working directory under
    target/native-servers/httpd/work/ is created with a generated httpd.conf, merged modules symlinks, and IfModule guards for cross-distro compatibility (Fedora vs Ubuntu built-in modules).
  • External mod_proxy_cluster modules — New -Dhttpd.modules.path property points to externally-built mod_proxy_cluster .so files, enabling CI builds from source via CMake.
  • Native httpd CI job — New native-httpd job on Ubuntu installs apache2-dev, builds mod_proxy_cluster from source, and runs SslCrlTest, SslFailoverTest, and StickySessionTest against
    system httpd.
  • Path handling cleanup — Replaced ad-hoc confFile.getParent().getParent() navigation with httpdHome / serverRoot(), added requireHttpdHome() and requireConfFile() guards for fail-fast on
    pre-start access, fixed RHEL8 JBCS layout support (httpd/sbin/httpd search path), added apache2 binary name support.
  • CI updates — All actions bumped to latest (checkout v6, setup-java v5, upload-artifact v7, action-junit-report v6), SslCrlTest added to test matrix.
  • Bug fixes — Fixed mTLS config written to wrong path, duplicate SSL IncludeOptional, stale SSL configs between test classes, misleading log messages and javadoc.

getModProxyClusterConfPath() returned a relative path, which
copyLocalFile() then resolved against httpdHome, doubling the path.
The SSL variant config silently went to a nested location while httpd
kept serving plain HTTP on the MCMP port.
@honza-kasik honza-kasik requested a review from marekkopecky June 1, 2026 06:11
Comment thread src/test/java/org/jboss/modcluster/test/utils/balancer/NativeHttpdBalancer.java Outdated
Replace ad-hoc confFile.getParent().getParent() navigation with
httpdHome field, add requireHttpdHome() guard for fail-fast on
pre-start access, fix RHEL8 JBCS layout support (httpd/sbin/httpd
search path), remove misleading log and redundant method call,
replace var with explicit types, and add SslCrlTest to CI matrix.
Guard public methods that dereference confFile (getConfDir, reload)
with a dedicated requireConfFile() helper, matching the existing
requireHttpdHome() pattern.
Support system-installed httpd via -Dhttpd.home (e.g. /usr) with
externally-built mod_proxy_cluster modules via -Dhttpd.modules.path.
A working directory under target/native-servers/httpd/work/ is created
with generated httpd.conf, merged modules symlinks, and conf.d/ for
the mod_proxy_cluster config template.

Add native-httpd CI job on Ubuntu that installs apache2, builds
mod_proxy_cluster from source via CMake, and runs the test suite.

Update all CI actions to latest versions (checkout v6, setup-java v5,
upload-artifact v7, action-junit-report v6). Document new properties
and system httpd setup in README.
Ubuntu's apache2 has some modules (e.g. unixd_module) compiled in as
built-in. Attempting to LoadModule a built-in module fails with a
syntax error. Wrap all LoadModule directives in the generated
httpd.conf with <IfModule !module_name> guards to skip modules that
are already loaded or built-in.
When multiple test classes run sequentially (e.g. SslFailoverTest
after SslCrlTest), stale ssl-data.conf files from the previous test
remain in conf/extra/ and cause "Cannot define multiple Listeners"
errors on the next httpd start. Delete and recreate the entire work
directory at the beginning of each setupSystemHttpdWorkDir() call.
Remove IncludeOptional conf/extra/ssl-*.conf from the generated
httpd.conf — the mod_proxy_cluster.conf template already includes it,
causing ssl-data.conf to be parsed twice and triggering "Cannot define
multiple Listeners on the same IP:port" on graceful restart.

Also clean the entire work directory on each start to prevent stale
SSL configs from prior test classes from persisting.
@honza-kasik honza-kasik changed the title Fix mTLS config written to wrong path on native httpd Add system httpd support and native httpd CI job Jun 1, 2026
@marekkopecky marekkopecky merged commit f348f9c into modcluster:main Jun 2, 2026
10 checks passed
@marekkopecky

Copy link
Copy Markdown
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants