You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Ray Shark <pi...@yahoo.com> on 2001/08/13 18:29:00 UTC

general/8174: Virtual host doesn't work with Port and Listen directives in httpd.conf together with VirtualHost.

>Number:         8174
>Category:       general
>Synopsis:       Virtual host doesn't work with Port and Listen directives in httpd.conf together with VirtualHost.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Mon Aug 13 09:30:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     pigliatutto@yahoo.com
>Release:        1.3.19
>Organization:
apache
>Environment:
Windows_NT 4.0 1381+Service_Pack_6 Pentium_Pro
>Description:
It seems that Apache HTTP Server works in a strange way when the configuration file contains both a Listen and a Port directive together with at least one virtual host. In this particular case Apache configures the virtual host with apparently wrong settings.

In particular starting Apache with the following (fragment) configuration

Port 80
Listen 90

<VirtualHost 123.45.678.9>
	ServerName name1
</VirtualHost>

it will start the Apache server (without producing any error/warning message) but the "main server" and not the virtual host (?!) will listen on address "123.45.678.9:90"... Moreover, running "Apache.exe -S" it shows
the following virtual host (?!)

123.45.678.9:80       name1 (d:/apache/conf/httpd.conf:1027)

All this is very strange! The main server had to be disabled and only the
virtual host "name1" had to listen on address 123.45.678.9:90 

Looking at the Apache documentation you can find the following considerations: 

1) In no event does a Port setting affect what ports a VirtualHost responds on, the VirtualHost directive itself is used for that.

2) In the absence of any Listen (or BindAddress) directives specifying a port number, a Port directive given in the "main server" (i.e., outside any 
<VirtualHost> section) sets the network port on which the server listens. If there are any Listen (or BindAddress) directives specifying :number then Port has no effect on what address the server listens at.

So it seems that there is something wrong.

>How-To-Repeat:
It is only necessary to run Apache with a configuration file that specifies
at least one Listen, a Port and at least one VirtualHost section.
>Fix:

>Release-Note:
>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 make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]