具有各种主机和 http/https 的 vhost

具有各种主机和 http/https 的 vhost

我的 vhosts.d 目录中有一个文件,名为 hosts.conf(据我所知,这个名字没有问题)。现在有各种主机,如您所见,如果我使用 http(端口 80),我可以从一个网站跳转到另一个网站,完全没有问题,但如果我使用 https(端口 443),无论我在浏览器中输入什么网站,我最终都会进入最先列出的带有 443 端口的网站(在本例中为 mobile-dev1)。*.it)。显然我的真实文件没有*写的但正确的网站名称。

<VirtualHost 10.65.200.7:80>
    DocumentRoot "/srv/www/htdocs/public"
    ServerName portal.***.it
    <Directory "/srv/www/htdocs/public">
        allow from all
    </Directory>
</VirtualHost>

<VirtualHost 10.65.200.7:80>
DocumentRoot /srv/mobile-dev1/public
ServerName mobile-dev1.***.it
<Directory /srv/mobile-dev1/public>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost 10.65.200.7:443>
DocumentRoot /srv/mobile-dev1/public
ServerName mobile-dev1.***.it
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile    /etc/ssl/certs/wildcard_***_it.pem
    SSLCertificateKeyFile /etc/ssl/private/wildcard_***_it.key
    SSLCertificateChainFile /etc/ssl/certs/RapidSSLCA.crt
<Directory /srv/mobile-dev1/public>
allow from all
Options +Indexes
</Directory>

<VirtualHost 10.65.200.7:80>
DocumentRoot /srv/mobile-dev2/public
ServerName mobile-dev2.***.it
<Directory /srv/mobile-dev2/public>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost 10.65.200.7:443>
DocumentRoot /srv/mobile-dev2/public
ServerName mobile-dev2.***.it
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile    /etc/ssl/certs/wildcard_***_it.pem
    SSLCertificateKeyFile /etc/ssl/private/wildcard_***_it.key
    SSLCertificateChainFile /etc/ssl/certs/RapidSSLCA.crt
<Directory /srv/mobile-dev2/public>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost 10.65.200.7:80>
DocumentRoot /srv/mobile-test/public
ServerName mobile-test.***.it
<Directory /srv/mobile-test/public>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost 10.65.200.7:443>
DocumentRoot /srv/mobile-test/public
ServerName mobile-test.***.it
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile    /etc/ssl/certs/wildcard_***_it.pem
    SSLCertificateKeyFile /etc/ssl/private/wildcard_***_it.key
    SSLCertificateChainFile /etc/ssl/certs/RapidSSLCA.crt
<Directory /srv/mobile-test/public>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

谢谢您的帮助,这个问题让我抓狂,因为它很可能是一些简单的事情......

答案1

我想到两件事:

  • 您没有NameVirtualHosts指令。它可能在您的其他配置文件中,但您需要NameVirtualHosts 10.65.200.7:443某个地方才能使其工作。

  • 您可能正在使用不支持信噪比。如果我没记错的话,XP 下的任何 IE 版本都不支持 SNI。您需要此功能是因为您有多个共享 IP 地址的 SSL 虚拟主机,而 Web 服务器区分它们的唯一方法是使用 SNI。

相关内容