httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leif W" <>
Subject Re: [users@httpd] Apache2/SSL/VirtualHost/single external IP
Date Sun, 17 Aug 2003 12:47:38 GMT
----- Original Message ----- 
From: "Robert Andersson" <>
To: <>
Sent: Sunday, August 17, 2003 7:43 AM
Subject: Re: [users@httpd] Apache2/SSL/VirtualHost/single external IP

> You are sure that DNS is working properly for the hostname. Connection

I'm using the hosts file, which I believe is looked at before DNS, so it is
finding the right IP.

> refused would not be the error if Apache was at fault. If Apache gets a
> request and can't find the appropriate VirtualHost, it will always serve
> from the first VHost defined on the IP of the incoming request.

But when I had the erroneous second secure VirtualHost section on the same
IP:port, I was getting the correct site, just the wrong certificate.

> Try doing a "telnet 80", and type:
>     GET / HTTP/1.1
>     Host:
> And see what you get.

Tried, and this just seems odd.

HTTP/1.1 200 OK

(HTML page from the "default" site, the very first VirtualHost definition)

[pause for about 5 seconds]

Connection to host lost.

Log file shows a successful request (status 200).

Oddly, the browser fails instantly (no pause as compared with the manual
telnet) with the connection refused message, and without leaving anything in
the log files.  Maybe the browser has the wrong IP stuck somewhere?  I
restarted the browser, now I get the same results as the telnet, I am seeing
the "default" site, not the expected

httpd.conf VirtualHosts section now looks like this:

NameVirtualHost *
# catch IP probes so they don't clutter other logfiles
<VirtualHost *>
    ServerName default

<VirtualHost *>

<VirtualHost *>

<IfDefine SSL>
    (stuff + ssl opts)

> ''.

I think this will be the most elegant solution, thanks for the tip.  It's
trivial to maintain the ":IP" in the conf and throughout my sites' PHP or
Perl scripts and HTML files.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message