我已经达到了我的Apache Web服务器上可用IP地址的限制,但越来越需要站点在SSL下运行。 我对一些在SNI下运行的站点感到满意,但其中一些站点需要在专用IP上提供SSL的后向兼容性。
那么,是否有可能在同一台服务器上混合使用两者?
是; 对于给定的监听器IP地址/端口组合,cert和SNI以及基于名称的虚拟主机逻辑与其他监听器是不同的
所以说,你想要192.0.2.50是SNI, 192.0.2.51和192.0.2.52作为专用IP:
NameVirtualHost 192.0.2.50:443 <VirtualHost 192.0.2.50:443> ServerName snisiteone.example.com # SSL directives here for this site's certificate to be served via SNI # Note that this cert, the first configured, will be used as default # for clients that don't support SNI </VirualHost> <VirtualHost 192.0.2.50:443> ServerName snisitetwo.example.com # SSL directives here for this site's certificate to be served via SNI - different cert! </VirualHost> <VirtualHost 192.0.2.51:443> ServerName dedicatedsite.example.com # SSL directives here for this site's certificate # Dedicated IP, so this'll be the only cert on this listener, SNI not used </VirualHost> <VirtualHost 192.0.2.52:443> ServerName dedicatedsitetwo.example.com # SSL directives here for this site's certificate # Dedicated IP, so this'll be the only cert on this listener, SNI not used </VirualHost>