码迷,mamicode.com
首页 > 其他好文 > 详细

[warn] _default_ VirtualHost overlap on port 80, the first has precedence

时间:2016-08-11 22:25:33      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:

解决[warn] _default_ VirtualHost overlap on port 80, the first has precedence问题
 
在apache2的httpd.conf里新增加了1个VirtualHost,域名是www.ligh.com,此时,服务器总共2个VirtualHost ,apachectl restart的时候却出现了下面的警告提示:
 
[warn] _default_ VirtualHost overlap on port 80, the first has precedence
 
大概意思就是说后面新增加的这个VirtualHost 由于端口被占用,不能生效,沿用第一个虚拟主机的配置。  www.2cto.com  
 
检查了一下,发现,原来在httpd.conf里,我没有把#NameVirtualHost *:80前的注释去掉,导致这个没有生效。
 
去掉#之后restart,问题解决,如果有https,则总体修改为
 
NameVirtualHost *:80
NameVirtualHost *:433
 
Linux系统重启apache出现:
 
[root@localhost conf]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: [Wed Jul 16 06:52:43 2008] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Wed Jul 16 06:52:43 2008] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Wed Jul 16 06:52:43 2008] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Wed Jul 16 06:52:43 2008] [warn] NameVirtualHost 124.254.31.4:80 has no VirtualHosts
看上面提示,发现了,apache虚拟主机出问题,警告:默认监听端口80上有重叠,在我们正常配置虚拟主机时,linux系统配置,XXX.conf 虚拟配置文件,一般都是默认访问在第一个站,表明虚拟主机没配置好。
 
解决方法:
编辑虚拟主机配置文件,改两处地方就可以了。
1.一处
NameVirtualHost *:80
2.二处
<VirtualHost *:80>
    DocumentRoot /home/wwwroot/
    ServerName xxx.com 
[root@localhost conf]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
 
 

[warn] _default_ VirtualHost overlap on port 80, the first has precedence

标签:

原文地址:http://www.cnblogs.com/xyh592/p/5762729.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!