Apache重启报别名错误(apache的端口)

 多个站点的定义如下
  #NameVirtualHost *:80
  #
  # VirtualHost example:
  # Almost any Apache directive may go into a VirtualHost container.
  # The first VirtualHost section is used for requests without a known
  # server name.
  #
  NameVirtualHost 127.0.0.1:80
  ServerAdmin devgg@devgg.com
  DocumentRoot /usr/local/tomcat/webapps/ronglian
  ServerName www.ronglian.com
  ErrorLog logs/ronglian.com-error_log
  CustomLog logs/ronglian.com-access_log common
  ServerAdmin devgg@devgg.com
  DocumentRoot /usr/local/wwwroot/chinaface
  ServerName www.chinaface.net
  ErrorLog logs/chinaface.net-error_log
  CustomLog logs/chinaface.net-access_log common
  在这里,NameVirtualHost的字段不能省略,否则起apache时报错:
  VirtualHost 127.0.0.1.80 overlaps with VirtualHost 127.0.0.1:80, the first has precedence, perhaps you need a NameVirtualHost directive——虽然apache能起,
  同错误描述一样,第二个站点的定义被第一个站点的定义所覆盖,即访问第二个站点指向的其实是第一个
  NameVirtualHost 字段的端口号不能忽略,否则起apache时报错:
  VirtualHost 127.0.0.1:80 — mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
  [error] VirtualHost 127.0.0.1:80 — mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results——apache不能起
  如果VirtualHost 字段的端口号确实可用,起apache时报错:
  VirtualHost 220.231.32.28:0 — mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results——
  但apache可以启动,访问也正常
  3 Could not reliably determine the server’s fully qualified domain name
  加入ServerName 127.0.0.1即可。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值