目前我有以下内容的“ports.conf”:
NameVirtualHost *:80 Listen 80 <IfModule mod_ssl.c> Listen 443 NameVirtualHost *:443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule>
所以要添加IPv6,我必须将其更改为:
NameVirtualHost 91.64.99.215:80 Listen 91.64.99.215:80 NameVirtualHost [2a01:4f8:140:54e4::3]:80 Listen [2a01:4f8:140:54e4::3]:80 <IfModule mod_ssl.c> Listen 443 NameVirtualHost 91.64.99.215:443 NameVirtualHost [2a01:4f8:140:54e4::3]:443 </IfModule> <IfModule mod_gnutls.c> Listen 91.64.99.215:443 Listen [2a01:4f8:140:54e4::3]:443 </IfModule>
它是否正确?
我的恐惧是,如果我这样做的话,所有的鬼都成立了
<VirtualHost *:80> ServerName www.domain.tld ServerAlias domain.tld DocumentRoot /www/domain </VirtualHost>
会疯狂的。 如果情况并非如此,那么做
<VirtualHost *:80 [*]:80> ServerName www.domain.tld ServerAlias domain.tld DocumentRoot /www/domain </VirtualHost>
还应该通过IPv6提供域名?
我在这里有点困惑,不能从现有的“例子”中获得太多的帮助。
您只需要将您的Listen指令更改为:
Listen [::]:80 Listen [::]:443
而你的
NameVirtualHost *:80 <VirtualHost *:80>
保持不变。
注意: netstat -tln将只显示tcp6 / :::80上的apache监听; 这是正常的(它也会像以前一样对IPv4做出响应)