fix(apache): default vhost port so vhosts bind an address - #98
Merged
Conversation
`port` is Optional in Eit_types::Web::Apache::Vhost_options, and the
profile passed it straight to apache::vhost. When unset, apache::vhost
falls back to the resource title for the vhost address, emitting
`<VirtualHost keyserver_webapp>`. Apache cannot resolve that as an
address and drops the vhost entirely:
AH00547: Could not resolve host name keyserver_webapp -- ignoring!
Every request then falls through to the default vhost. Hit in prod on
dkcphcochlear0{1,2}: the keyserver app vanished and clients got the
default docroot's directory index.
Default the port to 443/80 based on `ssl`, and use it in three places:
- apache::vhost's `port`, which is the actual fix
- the $listen_ports map, so a portless vhost still opens its firewall
port instead of relying on $https/$http happening to cover it
- monitor::domains, which was building `https://host:` with a trailing
colon whenever port was unset
Also add an optional `servername` passthrough. It defaults to the
resource title, which is rarely a resolvable hostname, so a vhost named
for the app rather than the site never matches a real Host: header.
Leaving it undef keeps the previous behaviour.
Aman1994
force-pushed
the
fix/apache-vhost-port-servername
branch
from
September 2, 2026 04:15
e73c1ad to
fd97b87
Compare
Aman1994
marked this pull request as draft
September 2, 2026 04:21
Aman1994
force-pushed
the
fix/apache-vhost-port-servername
branch
from
September 2, 2026 09:14
416f550 to
fd97b87
Compare
Aman1994
marked this pull request as ready for review
September 2, 2026 09:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
portis Optional in Eit_types::Web::Apache::Vhost_options, and the profile passed it straight to apache::vhost. When unset, apache::vhost falls back to the resource title for the vhost address, emitting<VirtualHost keyserver_webapp>. Apache cannot resolve that as an address and drops the vhost entirely:AH00547: Could not resolve host name keyserver_webapp -- ignoring!
Every request then falls through to the default vhost. Hit in prod on dkcphcochlear0{1,2}: the keyserver app vanished and clients got the default docroot's directory index.
Default the port to 443/80 based on
ssl, and use it in three places:port, which is the actual fixhttps://host:with a trailing colon whenever port was unsetAlso add an optional
servernamepassthrough. It defaults to the resource title, which is rarely a resolvable hostname, so a vhost named for the app rather than the site never matches a real Host: header. Leaving it undef keeps the previous behaviour.