Subject: Name Based HTTP vhosts and IP Based HTTPS vhosts

From: "Joe Pearson" <[email-masked]>
Date: Thu, 14 Feb 2002 13:56:14 -0700

I'm trying to setup to ssl virtual hosts.  When I start up the server, only
the last one in the configuration file gets recognized.  Does anyone have
any clue what I'm doing wrong?

NameVirtualHost 199.184.207.29

<VirtualHost 199.184.207.29:80>
DocumentRoot /home/httpd/homecu
ServerName www.domain.net
ServerAlias *.domain.net domain.net
</VirtualHost>

<VirtualHost 199.184.207.29:443>
ServerName www.domain.net
DocumentRoot "/home/httpd/homecu"
ErrorLog logs/error_log
TransferLog logs/access_log
SSLEngine on
SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /etc/httpd/conf/ssl.crt/www.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/www.key
SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0
CustomLog "|/usr/sbin/rotatelogs /etc/httpd/logs/access_ssl 86400" elf
</VirtualHost>

<VirtualHost 199.184.207.28:443>
ServerName www2.domain.net
DocumentRoot "/home/httpd/homecu"
ErrorLog logs/error_log
TransferLog logs/access_log
SSLEngine on
SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /etc/httpd/conf/ssl.crt/www2.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/www2.key
<Directory "/home/httpd/hcubin">
    SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0
CustomLog "|/usr/sbin/rotatelogs /etc/httpd/logs/access_ssl 86400" elf
</VirtualHost>
--
Joe Pearson
Database Management Services, Inc.
208-384-1311 ext. 11
http://www.webdms.com

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

---

From: Owen Boyle <[email-masked]>
Date: Fri, 15 Feb 2002 09:18:19 +0100

> any clue what I'm doing wrong?

Attempting the impossible... You can't use name-based VHs with SSL. See

http://www.modssl.org/docs/2.8/ssl_faq.html#ToC47
http://marc.theaimsgroup.com/?l=apache-modssl&m=98559369910170&w=2

Rgds,

Owen Boyle.

---

From: "Joe Pearson" <[email-masked]>
Date: Fri, 15 Feb 2002 06:39:24 -0700

---

From: "Joe Pearson" <[email-masked]>
Date: Fri, 15 Feb 2002 06:39:31 -0700

But I am trying to use IP based vitual hosts.  Are you saying I can't mix IP
based https with name based http?

---

From: Owen Boyle <[email-masked]>
Date: Fri, 15 Feb 2002 17:09:50 +0100

> based https with name based http?

whoops - my mistake, I just looked at your config again and you're *not*
trying to NBVH on 443...

Of course you can mix, IP, name-based and port-based VHs and your config
looks OK - except for one detail: www.domain.net and www2.domain.net
both have the same DocumentRoot so would look the same in the browser...

Apart from that, I didn't see any "Listen" Directives - you may have
them elsewhere, but I usually keep them next to the VH containers for
clarity. You would need:

Listen 199.184.207.29:80
Listen 199.184.207.29:443
Listen 199.184.207.28:443

NB - 443 isn't listened to by default) 

Also, since all your VHs are distinguished by IP or port, you don't need
the 

Rgds,

owen Boyle.