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

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

<VirtualHost 192.168.1.9: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>


David wrote:

> Hi,
>
> I tried adding port 80 to the virtual hosts as you suggested but the
> issue still persists?
>
> -David.
>
>
> Peter Viertel wrote:
>
>> 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>
>> 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 192.168.1.9:80
>>
>> <VirtualHost 192.168.1.9:80>
>> 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:80>
>> 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:80>
>> 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>
>>
>>
>> David wrote:
>>
>>> 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 PROTECTED]
>>> Automated List Manager                            [EMAIL PROTECTED]
>>
>>
>>
>>
>>
>> ______________________________________________________________________
>> Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
>> User Support Mailing List                      [EMAIL PROTECTED]
>> Automated List Manager                            [EMAIL PROTECTED]
>>
>
>
>
> ______________________________________________________________________
> Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
> User Support Mailing List                      [EMAIL PROTECTED]
> Automated List Manager                            [EMAIL PROTECTED]



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

Reply via email to