您当前的位置: 首页 > windows教程 > 电脑故障 > APACHE虚拟主机报错原因总结

APACHE虚拟主机报错原因总结

作者:不详 来源:网络 发布时间: 2011-09-14 13:46 点击:
[warn]NameVirtualHost*:0has no VirtualHosts 原因:The namevirtualhost command tells Apache that you will use VirtualHost boxes on a specific IP address.This command is needed only once for each IP address.It is not necessary to repeat the namevirtual

APACHE虚拟主机报错原因总结

  [warn]NameVirtualHost*:0has no VirtualHosts
  
  原因:The namevirtualhost command tells Apache that you will use VirtualHost boxes on a specific IP address.This command is needed only once for each IP address.It is not necessary to repeat the namevirtualhost directive for every VirtualHost box you use as in your example.The directive doesn't define a VirtualHost,it only tells Apache that on that IP address one or more virtual hosts will be present.
  
  解决办法:上面原因也说的很清楚啦,其实就是在apache的配置文件里把NameVirtualHost*.ip这行去掉就可以啦,下面的virtualhost里有东西就可以啦,这行就成了多余的累赘.
  
  [error](EAI2)Name or service not known:Failed to resolve server name for"**.**.**.**"
  
  这是apache虚拟主机没有设置域名,设置域名即可
  
  ServerName xsdx.cn
  
  [warn]VirtualHost X.X.X.X:80overlaps with VirtualHost X.X.X.X:80,the first has precedence,perhaps you need a NameVirtualHost directive
  
  在这里,NameVirtualHost的字段不能省略,否则起apache时报错:VirtualHost220.231.32.*.80overlaps with VirtualHost220.231.32.*:80,the first has precedence,perhaps you need a NameVirtualHost directive——虽然apache能起,同错误描述一样,第二个站点的定义被第一个站点的定义所覆盖,即访问第二个站点指向的其实是第一个
  
  NameVirtualHost字段的端口号不能忽略,否则起apache时报错:VirtualHost220.231.32.*:80--mixing*ports and non-*ports with a NameVirtualHost address is not supported,proceeding with undefined results
  
  [Sun Jul0916:59:372006][error]VirtualHost220.231.32.*:80--mixing*ports and non-*ports with a NameVirtualHost address is not supported,proceeding with undefined results——apache不能起
  
  如果VirtualHost字段的端口号缺失,起apache时报错:VirtualHost220.231.32.28:0--mixing*ports and non-*ports with a NameVirtualHost address is not supported,proceeding with undefined results——但apache可以启动,访问也正常
  
  例:
  
  NameVirtualHost111.111.111.111:80
  
  <VirtualHost111.111.111.111:80>
  
  ServerName aaa.3322.org
  
  DocumentRoot/var/www_zcg126
  
  </VirtualHost>
  
  <VirtualHost111.111.111.111:80>
  
  ServerName bbb.3322.org
  
  DocumentRoot/var/www_49
  
  </VirtualHost>

分享到:
本文"APACHE虚拟主机报错原因总结"由远航站长收集整理而来,仅供大家学习与参考使用。更多网站制作教程尽在远航站长站。
顶一下
(1)
100%
踩一下
(0)
0%
[点击 次] [返回上一页] [打印]
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
关于本站 - 联系我们 - 网站声明 - 友情连接- 网站地图 - 站点地图 - 返回顶部
Copyright © 2007-2013 www.yhzhan.com(远航站长). All Rights Reserved .
远航站长:为中小站长提供最佳的学习与交流平台,提供网页制作与网站编程等各类网站制作教程.
官方QQ:445490277 网站群:26680406 网站备案号:豫ICP备07500620号-4