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

            Bug ID: 57384
           Summary: default site configuration used instead of matching
                    virtual host, when ServerName equals machine host name
           Product: Apache httpd-2
           Version: 2.2.22
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Core
          Assignee: [email protected]
          Reporter: [email protected]

I have Debian 7 on my server matteosistisette.com
# cat /etc/hostname 
matteosistisette.com

Here are the contents of my available sites at /etc/apache2/sites-available:

/etc/apache2/sites-available/default:
http://pastebin.com/Zee7vLw5

/etc/apache2/sites-available/interferencesweb.org:
http://pastebin.com/DErqjgke

/etc/apache2/sites-available/matteosistisette.com
http://pastebin.com/ZSqmVYpZ

/etc/apache2/sites-available/sixty-seven.com
http://pastebin.com/fkC9Cdfh


If I enable all of them EXCEPT DEFAULT, everything works as expected: if a
client requests matteosistisette.com it gets matteosistisette.com, if it
requests interferencesweb.org it gets interferencesweb.org, and so on. However,
if a client requests directly the server's IP, or a domain that points to the
server's IP but is not any of the virtual hosts, the server looks for the
content in interferencesweb.org's root. Which is expected, I guess, being the
first one it's the first.


So, IF I ENABLE all of them, INCLUDING DEFAULT the issue appears:
* Expected behavior:
- if the client requests matteosistisette.com it should get
matteosistisette.com, if the client asks interferencesweb.org it should get
interferencesweb.org, and so on, but
- if it asks the IP directly, or a domain pointing to the IP that is not any of
the virtual hosts, then it should get the content at /var/www (which is the
default "it works!" page, but I intend to change it).

* Observed behavior:
- virtual hosts EXCEPT matteosistisette.com work as expected, i.e. if you
request sixty-seven.com you get sixty-seven.com, if  you request
interferencesweb.org you get interferencesweb.org, ...
- however, if you request matteosistisette.com (I guess because it is the one
that matches the host name in /etc/hostname), the default site is used instead
of using the one whose ServerName or alias matches the request.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to