Apache is optional supporting infrastructure selected through ADDONS.apache; it is not an application profile. It adds one reverse-proxy service that can be the host-facing entry point for application services on the shared Compose network. The generated baseline proxies one selected service and, for Django services, makes their static and document volumes available to Apache as read-only mounts.
The addon generates an HTTP listener and forwarded-request metadata. It does not provision DNS, firewall rules, certificates, an external load balancer, or an HTTPS virtual host.
Before starting a deployment, confirm that the deployment standards are synchronized to the expected commit or version. If they are not, follow the standards synchronization guideline, commit the synchronization changes, and then return to the deployment. Run the generated configuration check before starting containers.
Use the addon when a deployment needs a shared host-facing proxy, direct serving of generated Django static or document data, or explicit routing from multiple public hostnames or URL prefixes to services in one Compose deployment. Apache is optional; an application may instead remain on its profile-defined port behind infrastructure managed outside this repository.
| Path or service | Purpose | Ownership |
|---|---|---|
APP_SLUG-apache |
Apache HTTP service using registry.access.redhat.com/ubi9/httpd-24:latest |
Standard-managed Compose output |
conf/apache/00-logs.conf |
Source for Apache log formats and base log targets | Standard-managed |
conf/apache/01-reverse-proxy.conf |
Baseline virtual host plus the application-owned additional-route block | Standard baseline with preserved application-owned block |
conf/apache/02-server-status.conf |
Restricted server-status virtual host |
Standard-managed source |
conf/apache/apache_{test,production}_settings.txt |
Apache installation-setting templates | Standard-managed templates; production values are copied to protected deployment settings |
${APACHE_CONF_PATH}/*.conf (fallback: deployment/apache/*.conf) |
Runtime-rendered configuration mounted read-only into Apache | Generated by container_install.sh; do not edit |
APACHE_LOG_PATH |
Production host directory mounted at /var/log/httpd |
Deployment/operator-owned |
apache_test_logs |
Disposable test log volume | Compose-managed named volume |
The image is used directly; the repository does not build a custom Apache image. During installation, every uppercase shell-style variable in the three source configuration files is rendered into APACHE_CONF_PATH (or deployment/apache/ when empty), and only those rendered files are mounted into /etc/httpd/conf.d/.
Production defaults to /srv/containers/bind/<app-slug>/<app-slug>_apache_conf.
Set APACHE_CONF_PATH in the protected Apache settings to change the host directory;
an empty value uses <repository>/deployment/apache. Existing protected settings
with an empty value keep that fallback until updated.
ADDONS.apache.CONFIG_SERVICE selects the application whose context supplies the baseline route. It defaults to the first normalized application service. The installer derives APACHE_UPSTREAM_SERVICE, APACHE_UPSTREAM_PORT, INSTALL_PATH, APACHE_PROXY_TIMEOUT, and APACHE_LOG_STEM from this service unless their supported settings provide overrides.
Configuration ownership and proxy routing are separate concepts. CONFIG_SERVICE provides defaults for the baseline virtual host; it does not declare every service that custom virtual hosts or paths may proxy. Apache-owned settings cover its bind address and port, baseline public hostname, upstream defaults, forwarding metadata, request-body limit, logs, and restricted status endpoint. See the configuration variable reference for the exact variables.
The descriptor also accepts MODES to include Apache in production, test, or both, and MOUNTS for additional explicit volume or bind-mount strings. There are no implemented VIRTUAL_HOSTS or ROUTES descriptor options.
The generated baseline <VirtualHost *:8080> uses APACHE_SERVER_NAME and proxies / to http://${APACHE_UPSTREAM_SERVICE}:${APACHE_UPSTREAM_PORT}/. For the selected configuration service it excludes /static/ and /documents/ from proxying and serves those locations from ${INSTALL_PATH}/static/ and ${INSTALL_PATH}/documents/.
Additional virtual hosts and routes belong inside the preserved additional-apache-routes block in conf/apache/01-reverse-proxy.conf. The scaffold retains edits inside that block during synchronization, and the installer renders deployment variables before Apache starts.
Virtual-host routing uses different ServerName values to send different hostnames to different internal services. This is normally clearer when applications have distinct public DNS names because each application can keep root-relative URLs.
Path routing uses prefixes such as /api/ or /portal/ in one virtual host. It is valid only when the target application supports that prefix in its URL generation, redirects, static paths, cookies, and authentication callbacks. The proxy does not make an arbitrary root-based application prefix-aware.
Static/document exclusions and Alias directives must appear before a matching catch-all ProxyPass. Each additional virtual host should reproduce the forwarded-header, request-limit, timeout, and per-host logging behavior that its deployment needs; commented source examples are guidance, not active generated routes.
Apache reaches backends by Compose service name and internal application port on deployment_net, for example http://api:${API_APP_PORT}/. It does not proxy through an application's published host port. Compose service names are internal DNS identities and are different from browser-visible public hostnames.
Apache declares health-based depends_on entries for every application service and for dependency services exposed by other enabled addons. This orders startup against the generated topology, but does not mean every dependency has an active Apache route.
For every Django service, the compiler adds a read-only static volume and document volume at that service's own installation path. Production uses SERVICE_static and SERVICE_documents; test uses SERVICE_test_static and SERVICE_test_documents. The :ro,z mount options make the content read-only in Apache and request shared SELinux relabeling where supported.
These mounts are generated for all Django services in the descriptor, even when only some are referenced by the baseline or application-owned routes. React/Vite and Next.js assets remain with their application services; Apache normally proxies those services instead of receiving profile-owned asset volumes.
ADDONS.apache.MOUNTS can add deployment-specific mounts verbatim through the generic addon compiler. The operator is responsible for choosing valid sources, destinations, access modes, and any appropriate z or Z SELinux option for those custom mounts.
Apache listens on port 8080 inside the container and publishes it as ${APACHE_BIND_HOST}:${APACHE_PORT}. Production templates default to 0.0.0.0:8080; test defaults to 0.0.0.0:8081. Operators can use 127.0.0.1 when only a host proxy or local process should reach it.
Application profiles retain their own exposure rules. In production they generally publish application ports on loopback while Apache communicates with them directly over deployment_net. Whether Apache's configured host binding is reachable beyond the host depends on infrastructure firewall and network policy.
The generated Apache configuration contains no TLS listener, certificate mount, or certificate lifecycle. It accepts HTTP on container port 8080. APACHE_FORWARDED_PROTO and APACHE_FORWARDED_PORT describe the public request as seen before it reached this proxy; production defaults represent an external HTTPS endpoint on port 443, but they do not enable HTTPS in the container.
DNS, certificate provisioning and renewal, firewall rules, and any external TLS terminator or load balancer remain infrastructure responsibilities. If infrastructure forwards HTTPS traffic to this HTTP listener, its public hostname, scheme, and port must agree with the forwarded values used by the application.
The baseline preserves the original Host, disables automatic proxy-header additions, and explicitly sets X-Forwarded-Proto, X-Forwarded-Port, and X-Forwarded-Host. This avoids duplicated values and lets an upstream application reconstruct its public URL when its profile enables trusted forwarded-header handling.
APACHE_LIMIT_REQUEST_BODY configures LimitRequestBody and, when ModSecurity is loaded, the corresponding request-body limits. APACHE_PROXY_TIMEOUT configures both ProxyTimeout and TimeOut; it derives from the selected service's GUNICORN_TIMEOUT or falls back to 120 seconds. These are proxy controls, not replacements for application-side validation and timeouts.
Apache writes base access/error logs and per-virtual-host access/error logs beneath /var/log/httpd. Production bind-mounts APACHE_LOG_PATH there so logs survive container replacement and can be handled by host rotation or collection policy. Test uses the disposable apache_test_logs named volume and does not write to the production host path.
The standard defines combined and forwarded-client formats, but it does not configure log rotation, retention, shipping, or an external analysis platform. Those remain host or infrastructure responsibilities.
The installer creates the configured Apache host directory, renders the configuration files with mode 0644, and makes the directory traversable with mode 0755. In production it creates the log directory and applies ownership 1001:0 with mode 0775, matching the UID/GID used by the UBI Apache image. Apache has no writable named volume that requires an in-container ownership repair.
The shared permission helper applies the declared IDs directly for Docker and translates them through podman unshare when a rootless Podman user namespace requires it. Generated configuration and Django asset mounts use :z; production logs also use :z. Custom mounts must declare their own appropriate relabel option. SELinux should remain enabled; Unix ownership and SELinux labels are separate access controls.
The Compose healthcheck performs a bounded TCP connection to Apache port 8080. It proves that the listener accepts a connection, not that a virtual host, backend response, public DNS name, TLS endpoint, or server-status authorization works.
The generated smoke script currently has no Apache-specific route check. Generated post-install guidance tells the operator to verify the registered public URL, DNS/TLS path, proxy behavior, forwarded headers, and restricted status endpoint. Those are manual acceptance checks unless an application adds its own supported smoke coverage.
The separate status virtual host exposes /server-status only to values allowed by SERVER_STATUS_ALLOW_FROM; its default names and allow list are local-only. Exposure through DNS or routing still depends on the deployment's network configuration.
| Behavior | Test | Production |
|---|---|---|
| Default published address | 0.0.0.0:8081 |
0.0.0.0:8080 |
| Forwarded public scheme/port defaults | http / 8081 |
https / 443 |
| Default server name | localhost |
Required deployment DNS placeholder |
| Logs | apache_test_logs named volume |
APACHE_LOG_PATH host bind |
| Configuration source and rendering | conf/apache/ rendered to APACHE_CONF_PATH (or deployment/apache/ when empty) |
Same, using protected production settings |
| Backend and Django mounts | Generated from test service settings/volumes | Generated from production service settings/volumes |
| TLS inside Apache container | Not generated | Not generated |
One selected Apache addon is shared by the deployment. CONFIG_SERVICE supplies the default catch-all route, while each service exposes prefixed render variables such as API_APP_PORT, API_INSTALL_PATH, PORTAL_APP_PORT, or ADMIN_INSTALL_PATH for application-owned routing blocks. Do not create duplicated Apache-prefixed copies of those service values.
For example, a deployment can proxy portal.example.org to portal, api.example.org to api, and admin.example.org to admin using separate application-owned virtual hosts. Alternatively, it can use /portal/, /api/, and /admin/ only when all three applications support those prefixes. Each Django service already contributes its own read-only static and document mounts; non-Django services are normally proxied to their internal ports.
The scaffold does not infer public hostnames or generate one virtual host per service. Operators must define and validate every additional hostname or path route in the preserved Apache source block and provide every variable referenced by it in the applicable installation settings.
| Change | Correct owner |
|---|---|
| Baseline public hostname, listener, forwarded values, request limit, and upstream overrides | Protected Apache installation settings |
| Default configuration service, enabled modes, and custom mounts | Project descriptor ADDONS.apache |
| Additional public hostnames and path routes | Application-owned block in conf/apache/01-reverse-proxy.conf plus installation settings |
| Which service a custom route proxies | Application-owned Apache route using the service's generated prefixed values |
| Generic Apache templates, rendering, mounts, permissions, and Compose behavior | scaffold/templates/addons/apache/ |
| Application support for a URL prefix or forwarded headers | Application repository or profile |
| DNS, firewall, certificates, TLS termination, load balancing, and log operations | Deployment infrastructure |
Generated files under APACHE_CONF_PATH (or deployment/apache/ when empty) or generated Compose files |
Do not edit directly |
Application-specific Apache changes belong in the preserved source block. Reusable changes to the proxy contract belong upstream in the addon templates.