原因: The namevirtualhost command tells Apache that you will useVirtualHost boxes on a specific IP address. This command is needed onlyonce for each IP address. It is not necessary to repeat thenamevirtualhost directive for every VirtualHost box you use as in yourexample. The directive doesn't define a VirtualHost, it only tellsApache that on that IP address one or more virtual hosts will bepresent.
[error] (EAI 2)Name or service not known: Failed to resolve server name for "**.**.**.**"
这是apache虚拟主机没有设置域名,设置域名即可
ServerName xsdx.cn
[warn] VirtualHost X.X.X.X:80 overlaps with VirtualHost X.X.X.X:80,the first has precedence, perhaps you need a NameVirtualHost directive
在这里,NameVirtualHost的字段不能省略,否则起apache时报错:VirtualHost 220.231.32.*.80overlaps with VirtualHost 220.231.32.*:80, the first has precedence,perhaps you need a NameVirtualHostdirective——虽然apache能起,同错误描述一样,第二个站点的定义被第一个站点的定义所覆盖,即访问第二个站点指向的其实是第一个
NameVirtualHost字段的端口号不能忽略,否则起apache时报错:VirtualHost 220.231.32.*:80 --mixing * ports and non-* ports with a NameVirtualHost address is notsupported, proceeding with undefined results
[Sun Jul 0916:59:37 2006] [error] VirtualHost 220.231.32.*:80 -- mixing * portsand non-* ports with a NameVirtualHost address is not supported,proceeding with undefined results——apache不能起
如果VirtualHost字段的端口号缺失,起apache时报错:VirtualHost 220.231.32.28:0 -- mixing * ports andnon-* ports with a NameVirtualHost address is not supported, proceedingwith undefined results——但apache可以启动,访问也正常