服务器问题:Apache2 升级问题

服务器问题:Apache2 升级问题

我刚刚通过 webmin 在 debian 服务器上运行了 aptitude update,安装失败了,现在我的 Apache2 服务器无法正常运行,因为它无法识别“namevirtualhost”指令,服务器上托管的所有域都被重定向到默认服务器。幸运的是,Postfix 和 Dovecot 等其他服务都正常。

我应该怎样修复这个问题?

谢谢,RayQuang

更新 1: 重新启动 apache 时我收到的唯一错误是:

rayquang:~# /etc/init.d/apache2 force-reload
Reloading web server config: apache2[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:0 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:0, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:0 overlaps with VirtualHost 192.168.1.100:443, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:0, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Thu Feb 10 20:43:22 2011] [warn] VirtualHost 192.168.1.100:80 overlaps with VirtualHost 192.168.1.100:80, the first has precedence, perhaps you need a NameVirtualHost directive

答案1

从外观上看,这是 Debian 或 Ubuntu 安装。编辑/etc/apache2/ports.conf并替换:

名称虚拟主机 *:80

名称虚拟主机 192.168.1.100:80

然后重新加载 Apache。您还可以使用它apache2ctl -S来检查您的虚拟主机是否设置正确。

答案2

请注意,OpenSuSE 使用 listen.conf 而不是 ports.conf,但相同的解决方案有效。

相关内容