我使用的是Ubuntu 9.10,apache2和php5。 在一个IP地址上但在不同的端口上托pipe多个SSL站点是个好主意吗? 如果是的话,我应该使用什么端口?
使用任何你喜欢的端口,但知道这可能会导致用户混淆。 如果你想这样做,调整你的/etc/apache2/ports.conf文件并添加这样的内容(端口是cert的一部分):
<IfModule mod_ssl.c> # SSL name based virtual hosts are not yet supported, therefore no # NameVirtualHost statement here NameVirtualHost *:443 Listen 443 NameVirtualHost *:442 Listen 442 </IfModule>
然后编辑你的/ etc / apache2 / sites-enabled / somefile所以它有这样的东西:
<VirtualHost *:443> ServerName blah1.site.com more stuff here </VirtualHost> <VirtualHost *:442> ServerName blah2.site.com more stuff here </VirtualHost>
如果这是个问题,你可以使用mod_rewrite隐藏端口。
我想说这不是一个好主意,因为有一些防火墙设置为端口filter,故意让80(http)和443(https)通过并阻止其他端口。 或者他们警察在其他开放端口上讨论什么协议。 所以你会以这种方式散播你的观众。
烦恼的另一个来源是你的用户必须记得input正确的端口号,如果他们不想获得证书错误。 即:如果https://www.example.com:444/正确, https : //www.example.com :445 /将触发错误,如果端口445使用另一个站点的证书。
我从来没有尝试过,但我相信端口号码甚至必须是您的证书的一部分。
根据您的用例,您最好使用certificate* .example.com的通配符证书,并且可以使用该证书运行任意数量的子域。 如果您扩大规模,只要达到https://anysubdomain.example.com/ ,就可以在任意多台主机上使用此function。