www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trevor Foster <trev...@padd.press.net>
Subject config/143: When using VirtualHost configuration, 'GET /` uses defaults instead of virtual settings
Date Fri, 31 Jan 1997 14:10:02 GMT

	The contract type is `' with a response time of 3 business hours.
	A first analysis should be sent before: Fri Jan 31 11:00:02 PST 1997


>Number:         143
>Category:       config
>Synopsis:       When using VirtualHost configuration, 'GET /` uses defaults instead of
virtual settings
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Jan 31 06:10:02 1997
>Originator:     trevorf@padd.press.net
>Organization:
apache
>Release:        1.2B4
>Environment:
SunOS:4.1.2  compiler : gcc
>Description:
We have two virtual hosts set up using IP numbers, ie 
<VirtualHost 144.178.164.2> 
:
</VirtualHost>

When a simple 'GET /' is sent to one of these, the virtual host settings
are ignored and the software uses the default settings of the main server.

I have tracked this down to be a conflict betwwen the old type of virtual
hosts (which we are using), and the new, non-ip intensive variety. 
It seems that all virtual hosts are set to be the new type, which
HTTP /0.9 syntax cannot cope with as it gives no hostname information
via headers.

In the code, the condition statement for checking host type :

Line 1367, http_main.c
                if (sar->host_addr.s_addr == main_addr[n].s_addr
                    && s->port == mainport) {
                       s->is_virtual = 2;
                }

succeeds even for the old type of virtual host. This causes the search routine,
find_virtual_servers .... to fail.
>How-To-Repeat:
Declare two Virtual hosts using IP numbers, telnet to one of them and type GET /
>Fix:
For our site, a fix such as :

Line 1367, http_main.c

                if (sar->host_addr.s_addr == main_addr[n].s_addr) {
                        if (s->port == mainport) {
                                if (!strpbrk(s->addrs->virthost,"0123456789.")) {
                                        s->is_virtual = 2;
                                }
                        }
		}

seems to cure the probelm, as all virtual hosts are declared using IP addresses
>Audit-Trail:
>Unformatted:



Mime
View raw message