httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53334] New: non * name-based vhosts sometimes short-circut ServerName/ServerAlias
Date Thu, 31 May 2012 02:43:32 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53334

          Priority: P2
            Bug ID: 53334
          Assignee: docs@httpd.apache.org
           Summary: non * name-based vhosts sometimes short-circut
                    ServerName/ServerAlias
          Severity: normal
    Classification: Unclassified
                OS: Linux
          Reporter: covener@gmail.com
          Hardware: PC
            Status: NEW
           Version: 2.5-HEAD
         Component: Documentation
           Product: Apache httpd-2

when you use name-based vhosting and a non-wildcard host/ip argument to
<virtualhost>, httpd will accept the first  match between the incoming Host
header and the verbatim individual host/ip arguments to <virtualhost> without
ever checking ServerName/ServerAlias.

This never happens with * because the request hostname can't match *.

<virtualhost 1.2.3.4:80>
  ServerName www.example.com
</virtualhost>
<virtualhost 1.2.3.4:80>
  ServerName other.example.com
  ServerAlias 1.2.3.4
</virtualhost>

but http://1.2.3.4/ will route to the first vhost, not because it's the default
but because 1.2.3.4 is in [one of] the args to <virtualhost>.

AFAICT what it's trying to tolerate is:

host1.example.com=1.2.3.4
host2.example.com=1.2.3.4

NameVirtualHost 1.2.3.4
<virtualhost host1.example.com>
</virtualhost>
<virtualhost host2.example.com>
</virtualhost>

(this actually works w/o servername, but as a thought experiment consider
ServerName host1.example.com (yes, host1) in the 2nd VH will not do anything)

-/-

Anyway, the vhost resolution should warn of this  -- if the arg you used in
<vh> matches the requested hostname before a servername/serveralias is matched,
it will be used instead.

-- 
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


Mime
View raw message