Apache HTTP Server
Copy link to the page “Apache HTTP Server”Finds loaded TLS VirtualHosts and replaces the selected RSA or ECDSA certificate with a checked reload.
What happens
- The service agent on the server fetches the task from the appliance over outbound HTTPS, port 443.
- Discovery finds loaded VirtualHosts and their ordered certificate and key slots. Select the paths for the RSA or ECDSA slot to replace.
- The certificate and key are validated and staged beside the target files. Known key conflicts are refused before changes; previous files are protected for recovery.
- The files are switched, configuration is checked and Apache is reloaded. Recovery occurs only when the previously working service is observed broken after the switch. A running service reloads the restored files; only a stopped service is started.
- Verification uses the service parent process and local TLS responses for the selected slot. An accepted reload without sufficient evidence is reported with a warning.
Technical details
- Connection
- The integration runs through the service agent on the server. The service agent connects over outbound HTTPS to the appliance, port 443 by default. You open no port into the server.
- Service ports
- 443, 80
- What you need
- The service agent installed on the server. An SSH account that can read loaded configuration and certificates, write the selected files and their directories, and run fixed configtest, reload and start commands through scoped sudo.
- Platform
- Apache 2.4 and later
- Actions
- Discovery, Installation, Verification; no rollback action
- Integrations
-
apache-ssh1.4.1 - Note
-
- Discovery asks the running Apache where its configuration is: the process's -f and -d, else the systemd unit, else apache2 -V or httpd -V. Include and IncludeOptional are followed. Deploy also accepts files outside the standard folders when a VirtualHost in the live configuration uses exactly those files. The certificate chain consists of the intermediate certificates that link the server certificate to a root certificate the browser trusts.
- SSH login supports a password or private key. File writes run as this account; sudo permits only fixed service commands. Unknown loaded configuration is marked incomplete.
- The installation keeps a journal in the folder <certificate file>.sslbrain-state next to the certificate file. The folder must be owned by the account the installation runs as and have mode 0700; otherwise the installation stops with "State directory must be owned by deployment identity with mode 0700" before anything changes. Fix the owner and mode on the server and try again.
- Local TLS host, port and SNI fields are optional; otherwise known loaded listeners are used. RELOAD=false writes files only and warns that activation is unverified. Deployment checks intermediate presence; verify reports chain trust and name matching separately. Unverified activation does not block a later renewal, while unresolved recovery is reported as an error.
- For a mod_md managed name, optional TARGET_SERVER_NAME selects takeover. The certificate must cover all names; only the selected declaration switches to static files and manual renewal. The account must be able to write the configuration file and its directory. Other managed names are preserved. Renewing existing static mod_md files needs no configuration change.
- Alpine/musl and BusyBox environments support the same selected certificate paths. Install Bash, OpenSSL, GNU coreutils and util-linux flock; BusyBox does not replace Bash. Path length and allowed characters are checked on Alpine too.
- apache-ssh 2.0.0 is the next version, built for sslbrain v4 and released with it; until then the appliance installs 1.4.1 as described above. 2.0.0 runs the same scripts through the service agent on the server or over SSH. Over SSH it needs root or an account that may run sudo -n bash without a password, because the whole action runs as root. It keeps the inputs, the mod_md takeover and the rollback, and puts a given chain into the certificate file when CHAIN_PATH is not set.