Bug 73568

Summary: NameVirtualHost * not working
Product: [Retired] Red Hat Linux Reporter: Jef Spaleta <jspaleta>
Component: httpdAssignee: Joe Orton <jorton>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 2.0.47-5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-07-30 14:02:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jef Spaleta 2002-09-06 05:10:00 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.5 (X11; Linux i686; U;) Gecko/20020809

Description of problem:
the config file directive to allow namevirtualhosting attached to all ethernet
connections isn't working anymore

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.
# Use name-based virtual hosting.
#   attached to all ethernet interfaces
NameVirtualHost *

2. create virtualhost attached to all interfaces
<VirtualHost * >
ServerAdmin hmmm
DocumentRoot /home/example/
    ServerName www.example.com
    ErrorLog logs/example-error_log
    CustomLog logs/example-access_log common
</virtualhost>

3. service httpd restart



Actual Results:  error message produced on the console

Starting httpd: [Fri Sep 06 00:58:41 2002] [error] VirtualHost _default_:443 --
mixing * ports and non-* ports with a NameVirtualHost address is not supported,
proceeding with undefined results

and the virtual hosting doesnt work

Expected Results:  This should work as outlined in the apache manual
http://localhost/manual/vhosts/name-based.html
<quote>
For example, suppose that both www.domain.tld and www.otherdomain.tld point at
an IP address that the server is listening to. Then you simply add the following
to httpd.conf:

    NameVirtualHost *

    <VirtualHost *>
    ServerName www.domain.tld
    DocumentRoot /www/domain
    </VirtualHost>

    <VirtualHost *>
    ServerName www.otherdomain.tld
    DocumentRoot /www/otherdomain
    </VirtualHost>
</quote>

Additional info:

httpd-2.0.40-4 by the way.....


Looks like you MUSY add a port number to the NameVirtualHost directive
and the Virtualhost tags to get it to work.
NameVirtualHost *:80

    <VirtualHost *:80>
    ServerName www.domain.tld
    DocumentRoot /www/domain
    </VirtualHost>

    <VirtualHost *:80>
    ServerName www.otherdomain.tld
    DocumentRoot /www/otherdomain
    </VirtualHost>

This seems to work...but the manual says I don't need to ports.
And as a matter of fact the previous version of httpd I installed via the beta
worked.

Comment 1 Hans Ecke 2002-10-17 19:44:42 UTC
Workaround: Remove the mod_ssl package. It's configuration file 
/etc/httpd/conf.d/ssl.conf (or something) contains a "VirtualHost 
_default_:443" entry. 
 
This is an example how the /etc/httpd/conf.d/ mechanism can lead to difficult 
to diagnose problems.....

Comment 2 Joe Orton 2003-07-30 14:02:10 UTC
This will be fixed for the next release by giving the example with the port:

#NameVirtualHost *:80

as suggested.  Thanks for the report.