www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lew Payne <le...@netcom.com>
Subject config/710: IP-based VirtualHosts Broken.
Date Tue, 10 Jun 1997 04:40:02 GMT

>Number:         710
>Category:       config
>Synopsis:       IP-based VirtualHosts Broken.
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    apache (Apache HTTP Project)
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Mon Jun  9 21:40:01 1997
>Originator:     lewiz@netcom.com
>Release:        Apache/1.2.0
FreeBSD lppi.com 2.2.1-RELEASE FreeBSD 2.2.1-RELEASE #0: Fri Jun  6 19:20:41 PDT 1997
        lewis@lppi.com:/usr/src/sys/compile/WWW  i386
  Requests for a particular IP address, as defined in <VirtualHost>
directives, are ignored if the ServerName within the directive does
not match the browser's request!  That is, IP-based virtual hosts do
not work properly -- They are matched according to non-IP host rules.
This causes a big problem for browsers that do not supply the server
name in their request, and for browsers reaching the site via one of
its aliases, such as "site.com" in lieu of "www.site.com".

DNS configuration:
persiankitty.com      A

www.persiankitty.com  A

www.pay4play.com      A
pay4play.com          A

  A request for, with a supplied matching servername of
"www.persiankitty.com" gets set to the right VirtualHost.  The same
IP request, with a non-matching name of "persiankitty.com" does not
get processed by IP -- it goes to the default host.  A ServerAlias
directive might help this, but that still leaves a problem:  An IP
request, with NO servername specified by the browser, does not get
processed by IP -- it goes to the default host also.  Enabling and
monitoring logs proves my conclusion.
  As a test, I removed the "ServerName" directive from <VirtualHost>.
In that instance, requests with NO servername specified went to the
correct VirtualHost.  However, requests with either name specified
went to the default host.  Consistent with my theory.
  This applies to any of the IP addresses my systems hosts.  This
same behavior is seen on all three of my server machines!!!

ifconfig fxp0
        inet netmask 0xffffff00 broadcast
        inet netmask 0xffffff00 broadcast
        inet netmask 0xffffff00 broadcast
        ether 00:a0:c9:59:b5:e0

Relevant httpd.conf items:
ServerName     www.persiankitty.com
ServerAdmin    lewis@persiankitty.com
ServerRoot     /usr/local/etc/httpd
ErrorLog       logs/error_log
TransferLog    logs/default_log
LogFormat      "%{[%D-%T]}t %{host}i %h [%T] %b \"%r\" %>s"
CustomLog      logs/refer_log "%{referer}i -> %U"
PidFile        /var/run/httpd.pid

  ServerAdmin   lewis@persiankitty.com
  ServerName    www.persiankitty.com
  DocumentRoot  /home/persian/public_html
  #LogFormat    "%{%D %T}t [%T] %h %b \"%r\" %>s"
  TransferLog   /dev/null
  #ErrorLog     /home/persian/logs/error_log
  AddType       application/x-httpd-php .html

  ServerAdmin   lewis@persiankitty.com
  ServerName    www.pay4play.com
  DocumentRoot  /home/p4play/public_html
  LogFormat     "%{%D %T}t [%T] %h %b \"%r\" %>s"
  TransferLog   /home/p4play/logs/trans_log
  ErrorLog      /home/p4play/logs/error_log
  AddType       application/x-httpd-php .html
Simple!!  Go to and then to www.pay4play.com --
both should send you to the same virtual host, but they don't !!
Clean up non-IP based virtual hosting code, which seems to have
bled into IP-based virtual hosting code

View raw message