Subject: SSL site loads regardless of URL??

From: David <[email-masked]>
Date: Mon, 17 Jun 2002 19:24:01 +1200

Hi,

I have several virtually hosted web sites and only one site that is
configured for SSL on my server.

The issue is if someone uses https instead of http the certificated site 
pages load regardless of the url ie

http://stats.domain1.co.nz loads pages from ../domain1 which is correct.

https://stats.domain1.co.nz loads pages from ../donations, and the url 
remains https://stats.domain1.co.nz

I assume I have a misconfigured .conf file?

How can I resolve this, do I need to specify port 80 on the http sites 
or do I need to multi home the server with a unique IP for the SSL site?

Thanks

-David.

Below is an illustration of the httpd.conf.

<VirtualHost www.donations.org.nz:443>
ServerName www.donations.org.nz
DocumentRoot /var/www/html/donations
ErrorLog /var/log/httpd/donations-error_log
TransferLog /var/log/httpd/donations-access_log
</VirtualHost>

NameVirtualHost 219.88.240.45

<VirtualHost 192.168.1.9>
ServerName stats.domain1.co.nz
DocumentRoot /var/www/html/domain1
ErrorLog /var/log/httpd/domain1-error_log
TransferLog /var/log/httpd/domain1-access_log
</VirtualHost>

<VirtualHost 192.168.1.9>
ServerName stats.domain2.co.nz
DocumentRoot /var/www/html/domain2
ErrorLog /var/log/httpd/domain2-error_log
TransferLog /var/log/httpd/domain2-access_log
</VirtualHost>

<VirtualHost 192.168.1.9>
ServerName stats.domain3.co.nz
DocumentRoot /var/www/html/domain3
ErrorLog /var/log/httpd/domain3-error_log
TransferLog /var/log/httpd/domain3-access_log
</VirtualHost>

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [email-masked]
Automated List Manager                            [email-masked]

---

From: "Peter Viertel" <[email-masked]>
Date: Mon, 17 Jun 2002 08:52:02 +0100

Virtual hosts are defined agains the listening addresses you have for 
your host:

Not sure what some of the host names resolve to but assuming 192.168 
addresses are the actual ip of your host, and the other ip is the nat 
outside address for your host then the config would look like this:

<VirtualHost 192.168.1.9:443>

NameVirtualHost 192.168.1.9:80

<VirtualHost 192.168.1.9:80>

<VirtualHost 192.168.1.9:80>

<VirtualHost 192.168.1.9:80>

---

From: David <[email-masked]>
Date: Tue, 18 Jun 2002 11:54:15 +1200

Thanks for the comments Peter,

The server has real world IP's. I just used 192.. for the example. Which 
probably was dumb as it clouded the issue.

-David

---

From: David <[email-masked]>
Date: Tue, 18 Jun 2002 12:48:24 +1200

Hi,

I tried adding port 80 to the virtual hosts as you suggested but the 
issue still persists?

-David.

---

From: "Peter Viertel" <[email-masked]>
Date: Tue, 18 Jun 2002 09:42:11 +0100

I went back and read your question again, and can see I missed your 
problem entirely.

You can only have one SSL certificate per IP - that is to say that 
namevirtualhost does work on https, but always only one cert.. .this is 
because of the number one most FAQ on this list which is what Ralf 
describes as 'Some sort of chicken and egg problem' in his mod_ssl FAQ.

If you want to make it so your ssl pages only come up when the client 
uses the right hostname then try this hack:

NameVirtualHost 192.168.1.9:443

ServerName oddshostnames
RewriteEngine On
RewriteRule    ^    [F,L]
</VirtualHost>