httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [users@httpd] strange behaviour of mod_vhost_alias
Date Wed, 20 Nov 2002 11:12:57 GMT
On Tue, Nov 19, 2002 at 08:24:41PM -0500, Joshua Slive wrote:
> I've seen one other report that I recall as being vaguely similar to
> yours.  Technically, Apache should NEVER use a name-based virtualhost that
> doesn't have a ServerName/ServerAlias unless it is listed first.  You may
> have discovered a bug.
> Does the order of the listing of the <VirtualHost>s matter?  Do you get
> the same thing with an ordinary DocumentRoot in the second vhost, rather
> than a VirtualDocumentRoot?

I just extended my small config to include more <VirtualHosts>. The
phenomena can be described as following:

If V_1....V_n   are my VirtualHost-Sections

As soon as there is a V_a with a VirtualDocumentRoot inside *before*
(a<b) the V_b with the "canonical" hostname (reverseloopup of IP) as
ServerName inside then requests for this canonical hostname are
answered with V_a instead of V_b.

As soon as b<a the phenomena vanishes.  I tested with up to 7
VirtualHosts and V_a (containing the VirtualDocumentRoot) was put to
all positions. As soon as it was listed before V_b I had the problem:

example with 5 VirtualHosts:
(a=3, b=4)


## V_1
DocumentRoot /data/apache/t1
## V_2
DocumentRoot /data/apache/t3

## V_3
  VirtualDocumentRoot /data/apache/t-virt
## V_4 
#     problematic hostname = reverse lookup of
DocumentRoot /data/apache/t2
## V_5
#     same config than but with different result
DocumentRoot /data/apache/t2

wget c2.goldfisch,at => t-virt !!!!
wget x2.goldfisch,at => t2

As soon as I exchange V_3 and V_4 the problem vanishes. So I really
think its a bug. In my case its a serious bug, cause I cant (and dont
want to) change the reverse-look-up of our ip's and I used the
canonical hostname for lot of things.

As I'm not a big programmer but know about networks and sockets I'm
"quite sure" that apache does a reverse lookup on the ip its listening
and then handle this domain different. I played around with
UseCanonicalHostname-directive and put it On and Off but it didnt
change the behaviour of apache2. 
 I was sensible to this type of problem, cause sendmail has a very
similar behavior making it very difficult (not to say impossible) to
receive mails for the canonical hostname using "mailertable" which is
kind of the equivalent to mod_vhost_alias at sendmail.

thnx a lot for your help again,

mag. peter pilsl
tel: +43-699-1-3574035
fax: +43-699-4-3574035

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message