当我运行 /etc/init.d/apache2 restart 命令重新启动网络服务器时,我收到以下警告:
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 工作正常。
还是我应该尝试修复它?
无需对此做任何事情。这只是意味着apache注意到了IP。请求将转到默认的虚拟主机。
您为 188.40.153.185:443 配置了两个虚拟主机。这让 apache 感到困惑,他只接受第一个。您应该合并这些虚拟主机或更改秒虚拟主机的 ip,具体取决于您想要实现的目标。
或者,如果您正在使用基于名称的虚拟主机(可能使用 ssl,但不是最好的方式),您需要添加一条
NameVirtualHost
指令,如错误消息之一所述。