You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Mark Morley <ma...@islandnet.com> on 1998/02/03 21:13:08 UTC

general/1768: Virtual hosts not properly recognised

>Number:         1768
>Category:       general
>Synopsis:       Virtual hosts not properly recognised
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Feb  3 12:20:00 PST 1998
>Last-Modified:
>Originator:     mark@islandnet.com
>Organization:
apache
>Release:        1.2.5
>Environment:
Pentium Pro 200, RedHat Linux 4.2
>Description:
We have three identical web servers, all Pentium Pro 200s running RedHat Linux
version 4.2  We have a fourth web server on a Sparc 20 running SunOS.

We assign a unique IP number to a virtual web site, and in the DNS tables
define both "X.COM" and "WWW.X.COM" to point to this IP number so that the
"www" part is optional.

In the config file we have an entry like this:

   <VirtualHost A.B.C.D>
   ServerName x.com
   DocumentRoot /home/x/x/www
   </VirtualHost>

On two Pentium boxes (and one SunOS web server) this works perfectly.  You can
access "http://x.com", "http://www.x.com", and "http://a.b.c.d" and get the
exact same page for each one.

On the third Pentium box, it only works if you use "http://x.com".  Using the
"www" version or the IP number directly gives us the default web page rather
than the user's virtual site.

If we change the ServerName directive to "www.x.com", then "http://www.x.com"
works but "http://x.com" returns the wrong page.

We are using the exact same Apache binary on all the machines, and line-by-line
comparisons of all the config files show no differences.  All IPs are within
the same class C space, etc.

Any ideas why this works on three other web servers and not on this one?

Mark
>How-To-Repeat:
Both "test.islandnet.com" and "www.test.islandnet.com" point to 207.102.50.249
yet only "http://test.islandnet.com" works as it should.
>Fix:

>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <ap...@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]