You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2014/05/08 01:03:34 UTC

[Bug 56500] New: vhosts priority order with wildcard

https://issues.apache.org/bugzilla/show_bug.cgi?id=56500

            Bug ID: 56500
           Summary: vhosts priority order with wildcard
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Core
          Assignee: bugs@httpd.apache.org
          Reporter: me@ninosego.de

OS: Debian Wheezy x64
Server version: Apache/2.2.22 (Debian)

Hey there, I wanted to create a server default page and found following error.
At first, I have configuration files like 00_master.conf, domain1.conf.

In the 00_master.conf you can find the defined vhost for the admin panel (I'm
using an iscp [i-mscp.net]). Here's an example:

<VirtualHost SERVERIP:80>
    ServerName admin.srv01.example.tld (url to the panel)
    DocumentRoot /var/www/.../panel/
    ...
</VirtualHost>


For the domains I'm using following:

<VirtualHost SERVERIP:80>
    ServerName domain1.tld
    ServerAlias www.domain1.tld
    DocumentRoot /var/www/.../domain1.tld/
    ...
</VirtualHost>


No to my problem. As already mentioned I want to add a server default page. So
if someone is visiting an url like "doesnotexists.domain1.tld" or
"asd.admin.srv01.example.tld" I want to show a default page with an static html
output like "Site not found" or something like that.

For that I added in the 00_master.conf over the first vhost another vhost,
which should be used if no ServerName is defined. I tried with a hardcoded ip
and it works fine. Here's an example:

<VirtualHost SERVERIP:80>
    DocumentRoot /var/www/.../default
    </Directory>
</VirtualHost>

But if I use an wildcard like *:80 or _default_:80 the vhost will not be used.
I think it's because of a wrong priority of the vhosts.

Best regards,
Ninos

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 56500] vhosts priority order with wildcard

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56500

Ninos <me...@ninosego.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 56500] vhosts priority order with wildcard

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56500

--- Comment #2 from Ninos <me...@ninosego.de> ---
I think the design is a little bit wrong or wrong implemented. The vhosts with
the wildcard should have a higher priority on a not defined vhost. Here're some
examples:

EXAMPLE 1
Visit:
Domain: example1.com
IP: IP1

Defined vhost:
Domain: example2.com
IP: IP1

Priority:
Current: IP1:example2.com -> wildcard
Should be: wildcard -> IP1:example2.com


EXAMPLE 2
Visit:
Domain: example1.com
IP: IP1

Defined vhost:
Domain: example2.com
IP: IP2

Priority:
Current: wildcard -> IP2:example2.com
Should be: wildcard -> IP2:example2.com


EXAMPLE 3
Visit:
Domain: example1.com
IP: IP1

Defined vhost:
Domain: *
IP: IP1

Priority:
Current: IP1:* -> wildcard
Should be: IP1:* -> wildcard

What I mean is, if all vhosts have a defined ServerName (expect whildcard), the
vhosts shouldn't have a higher priority than the wildcard IF the domain can't
be matched with a vhost. If someone want's to match all undefined ip-requests
to a vhost, he can also use a wildcard for the ServerName. (Servername
*,example1.com, *.example1.com).

This design would be cleaner and more logical.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 56500] vhosts priority order with wildcard

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56500

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |enhancement

--- Comment #5 from Eric Covener <co...@gmail.com> ---
(In reply to Ninos from comment #4)
> I understand the current mapping and also know now, that's not a bug.

Reclassifying as an enhancement. I don't think it's well defined here thouh.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 56500] vhosts priority order with wildcard

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56500

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Eric Covener <co...@gmail.com> ---
Not a bug, this is by design. IP/interface based mapping first, name-based
mapping second.  

If you just want name-based, you have to limit yourself to all *:port. 
Otherwise, ip-based discrimination happens first.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 56500] vhosts priority order with wildcard

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56500

Ninos <me...@ninosego.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |me@ninosego.de
            Version|2.5-HEAD                    |2.2.22

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 56500] vhosts priority order with wildcard

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56500

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Eric Covener <co...@gmail.com> ---
This is working as desined -- If there's a wildcard and an exact match IP in
the <virtualhost>, the exact match wins and the name-based vhost will be picked
from the best IP-based match.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 56500] vhosts priority order with wildcard

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56500

Ninos <me...@ninosego.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #4 from Ninos <me...@ninosego.de> ---
I understand the current mapping and also know now, that's not a bug. In my
second comment I asked for a little modified design, because for me my example
seems more logical. :)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org