当我运行 /etc/init.d/apache2 restart 命令重新启动 Web 服务器时,出现以下警告:
Restarting web server: apache2[Sat Jan 09 23:27:46 2010] [warn] VirtualHost 188.40.153.18
5:443 overlaps with VirtualHost 188.40.153.185:443, the first has precedence, perhaps you
need a NameVirtualHost directive
[Sat Jan 09 23:27:46 2010] [warn] NameVirtualHost 188.40.153.190:80 has no VirtualHosts
[Sat Jan 09 23:27:46 2010] [warn] NameVirtualHost 188.40.153.190:443 has no VirtualHosts
... waiting .[Sat Jan 09 23:27:48 2010] [warn] VirtualHost 188.40.153.185:443 overlaps w
ith VirtualHost 188.40.153.185:443, the first has precedence, perhaps you need a NameVirt
ualHost directive
[Sat Jan 09 23:27:48 2010] [warn] NameVirtualHost 188.40.153.190:80 has no VirtualHosts
[Sat Jan 09 23:27:48 2010] [warn] NameVirtualHost 188.40.153.190:443 has no VirtualHosts
.
我的服务器上有一个 IP 未分配虚拟主机。我想这没什么坏处,因为 Apache 运行正常。
或者我应该尝试修复它?
答案1
无需对此做任何事情。这只是意味着 apache 注意到了 IP。请求将转到默认虚拟主机。
答案2
您为 188.40.153.185:443 配置了两个虚拟主机。这会让 apache 感到困惑,它只会接受第一个。您应该合并这些虚拟主机或更改第二个虚拟主机的 IP,具体取决于您想要实现的目标。
或者,如果您正在使用基于名称的虚拟主机(可以使用 SSL,但不是最好的方式),您需要添加一个NameVirtualHost
指令,如其中一条错误消息所述。