First HTTPS installation through CLI: verification and rollback
A fresh Debian disk, actual CLI stages, protected HTTPS and bounded rollback. Password checks, retained services and replay without another reload.
First HTTPS installation needs its own evidence
Protected HTTPS already works on the teaching E-01. Verifying that server confirms an existing configuration. It does not yet establish that automation can create the configuration when its files are absent. I therefore moved this next step to a separate disposable Debian VM.
The VM boots from a fresh disk. PHP-FPM, the minimal Symfony application and the firewall were prepared through their actual CLI stages. No journals were copied from another server. Composer installed dependencies from the lock file; no prepared vendor tree was transferred.
Requirements before the first write
The installer accepts a verified private application and absent HTTPS roles. An occupied directory or configuration fragment stops it. Existing foreign files do not silently become installer-owned.
A separate check requires the exact closed management firewall policy and its owner's committed journal. The owning firewall lock remains held throughout the operation. This mode accepts the initial policy; WireGuard or Cloudflare rule extensions need an explicit subsequent mode. Installation does not change network rules.
The plan is still a private artifact
The plan binds file roles, initial service state, application evidence and verified TLS material. OpenSSL generates a salted SHA512-crypt password verifier. That exact result is retained so apply cannot silently generate a different salt.
A plan without a plaintext password can still contain a sensitive password verifier. Keep it private and out of Git. The private key travels through stdin only for installation; a standalone verification does not send it to the server. This standard interactive example illustrates verifier generation, not the implementation of our CLI:
# Interactive password input; do not publish the resulting verifier.
openssl passwd -6
The -6 option is documented by OpenSSL. Nginx documents crypt password support in its BasicAuth module.
Four files and one reload
The new directory uses root/worker0750. The certificate and private key use root0600, the authentication file root/worker0640 and the separate Nginx fragment root0644. The worker group comes from the actual web identity.
A syntax check precedes the sole reload. These ordinary administration commands explain the order; they are neither the complete CLI nor a raw execution transcript:
if sudo nginx -t; then
sudo systemctl reload nginx.service
fi
During reload, the master applies configuration and launches new workers while old workers finish existing connections. Nginx describes this in its control documentation. Our contract requires the Nginx master and PHP-FPM process to remain unchanged.
Verifying behavior after installation
Completion requires HTTPS with an explicitly verified CA and exact certificate, 401 without a password and with a wrong password, the expected Symfony404 with the correct password, denied paths, wrong Host, HTTP308 and rejection of a wrong SNI. Application responses retain noindex/nofollow and private/no-store.
The VM uses a separate fixture CA with explicitly pinned trust. This is neither Cloudflare Origin CA issuance nor evidence of publicly trusted TLS. DNS, provider routes and Internet access belong to separate stages.
Removal requires creation evidence
A separate rollback plan accepts only an unchanged, fully committed installation with exact creation evidence. It removes the owned fragment, checks syntax, reloads once, then deletes unchanged TLS material and the empty owned directory. The installation journal is retained; removal receives a new journal.
An unknown reload outcome or partially completed writes stop a repeated invocation. File presence does not establish completion. Rolling back a committed installation also does not substitute for a separate interrupted-operation reconciliation procedure.
The actual isolated result
First installation, automatic verification through a fresh SSH connection, standalone verify and apply replay passed. All 45 selected file images retained exact bytes and metadata across verify/replay. Rollback also passed apply, fresh SSH confirmation, standalone verify and replay without another reload. Exactly four TLS files were removed; 41 previously selected files were retained, with only two files added for the separate rollback journal.
After rollback, private Symfony operates in its original mode, web ports are closed, and the Nginx master and PHP-FPM identities are retained. Interrupted operations and unknown reload outcomes were separately exercised in controlled test scenarios; no live unknown failure was injected into the VM. This run changed neither the active E-01 nor production.
