Mailing List Archive

[Bug 64996] New: clarifications about vhost matching
https://bz.apache.org/bugzilla/show_bug.cgi?id=64996

Bug ID: 64996
Summary: clarifications about vhost matching
Product: Apache httpd-2
Version: 2.5-HEAD
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: Documentation
Assignee: docs@httpd.apache.org
Reporter: calestyo@scientia.net
Target Milestone: ---

Hey.

I think there are several ambiguities about vhost matching in the
documentation:


1) In vhosts/name-based.html
From the overall text there, it doesn't really become clear that _no_
<VirtualHost> where either IP or port is the wildcard ("*") will be used (as
fallback) if there is an explicit *any* IP:port match, even if the
ServerName/ServerAlias doesn't match at all.

<VirtualHost *:*>
#vhostA
</VirtualHost>
<VirtualHost 10.10.10.10:80>
#vhostC
ServerName example.org
</VirtualHost>
<VirtualHost 10.10.10.10:80>
#vhostD
ServerName example.com
</VirtualHost>

A request to 10.10.10.10:80 with a "Host: foobar.invalid" would still go to
vhostC, even though neither ServerName/ServerAlias matches.
I think this is kinda more generally important, as people will often want to
prevent "wrong" Host-Header-Requests to end up on a "normal" vhost, but rather
on some catch-all vhost, which they might think the *:* could be.
Instead they'd need, for each and every IP:port combination another catch-all
vhost like:
<VirtualHost 10.10.10.10:80 20.20.20.20:8080 ...[every other used IP:port
combination] >
#vhostB
ServerName example.org
DocumentRoot /some/invalid/host
</VirtualHost>
coming in between vhostA and vhostC (or better said, before C and D).


2) in vhosts/details.html
it's a bit better explained, because it says

> If there are no exact matches for the address and port, then wildcard (*) matches are considered.

but it's still not 100% clear because it says "then wildcard..." and not "then
AND ONLY THEN wildcard..."

Perhaps it should be even more clear than that and saying: as soon as
explicit/literal IP:port match is found,... those vhosts will be used EVEN if
they don't contain any matching ServerName/ServerAlias (in which case the first
matching vhost will be used)... and EVEN if another vhost with wildcards would
contain a matching ServerName/ServerAlias


Cheers,
Chris.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org