Apache Virtual Server

Tim ignored_mailbox at yahoo.com.au
Thu Apr 30 13:16:15 UTC 2009

On Thu, 2009-04-30 at 08:30 -0400, Mike Burger wrote:
> Having read the entire thread, so far, I don't believe that anyone
> else has actually identified the issue.
> The issue is the use of:
> <VirtualHost *:80>
> You've got a wildcard in every "VirtualHost" declaration.  As a
> result, you're going to match on the very first VirtualHost, and never
> get past it.

That's the normal way it works, that's why no-one's said what you have.
The ServerName and ServerAlias directives inside each virtual host is
where the matching takes place.  ServerName being the canonical name it
should use, and ServerAlias listing any alternative aliases.

If you were going to put anything in there, it would be an IP address.
And your server would have to have just a single address, you'd have
problems if it had two addresses, and you tested on both (e.g. internal
and external addresses).

The usual problem with virtual hosts, is that the first thing that
matches, wins.  If something does manage to match, and it's ahead of
your virtual host definitions, that's the problem.

I think there's two threads on this subject running at the moment, and
I'm getting confused as to which has been resolved.

Looking back at a posting by the original poster, they had this in it:

[root at confianza conf]# cat /etc/hosts        localhost.localdomain localhost        confianza        confianzaZend
::1        localhost6.localdomain6 localhost6    amor                    amor.    esperanza    confianza     BRNEE2FCB    glitter    fe

They've got the same hostname associated with two different IP
addresses, that might cause its own problems.  I'd always leave the
local loopback addresses alone ("" & "::1"), only ever adding
hostnames to other IPs.  But I don't think that's the cause of this

They had a sample with PHP testing the hostname, but I suspect that
might behave differently than what's differentiating hosts apart (you
can have one server replying to several host names, and it'll use the
*requested* hostname (by the client) in the query to match, rather than
getting the name from the server.

[tim at localhost ~]$ uname -r

Don't send private replies to my address, the mailbox is ignored.  I
read messages from the public lists.

More information about the users mailing list