httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pi...@goldfisch.at
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)


NameVirtualHost 62.99.149.139
 

## V_1
<VirtualHost 62.99.149.139>
ServerName x1.goldfisch.at
DocumentRoot /data/apache/t1
</VirtualHost>
 
## V_2
<VirtualHost 62.99.149.139>
ServerName x3.goldfisch.at
DocumentRoot /data/apache/t3
</VirtualHost>

## V_3
<VirtualHost 62.99.149.139>
  VirtualDocumentRoot /data/apache/t-virt
</VirtualHost>
 
## V_4 
<VirtualHost 62.99.149.139>
#     problematic hostname = reverse lookup of 62.99.149.139
ServerName c2.goldfisch.at
DocumentRoot /data/apache/t2
</VirtualHost>
 
## V_5
<VirtualHost 62.99.149.139>
#     same config than c2.goldfisch.at but with different result
ServerName x2.goldfisch.at
DocumentRoot /data/apache/t2
</VirtualHost>


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


-- 
mag. peter pilsl
IT-Consulting
tel: +43-699-1-3574035
fax: +43-699-4-3574035
pilsl@goldfisch.at
http://www.goldfisch.at

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message