httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leif W" <warp-...@usa.net>
Subject Re: [users@httpd] Apache2/SSL/VirtualHost/single external IP
Date Sun, 17 Aug 2003 12:47:38 GMT
----- Original Message ----- 
From: "Robert Andersson" <robert@profundis.nu>
To: <users@httpd.apache.org>
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 www.site2.net 80", and type:
>
>     GET / HTTP/1.1
>     Host: www.site2.net
>
> And see what you get.

Tried, and this just seems odd.

HTTP/1.1 200 OK
(headers)

(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 www.site2.net.

httpd.conf VirtualHosts section now looks like this:

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

<VirtualHost *>
    ServerName www.site1.org
    (stuff)
</VirtualHost>

<VirtualHost *>
    ServerName www.site2.net
    (stuff)
</VirtualHost>

<IfDefine SSL>
NameVirtualHost 192.168.7.7:443
<VirtualHost 192.168.7.7:443>
    ServerName www.site1.org
    (stuff + ssl opts)
</VirtualHost>
</IfDefine>

> 'https://secure.site2.net:444/'.

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.

Leif



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message