win10下修改host后仍无法打开本地网页原因

系统运维 waitig 575℃ 百度已收录 0评论

最近按教程想把www.baidu.com指向我做的网页,却无法打开,很苦闷,修改如下:

host红色部分是我修改:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1       localhost
# ::1             localhost
# 180.97.157.28   hub5idx.shub.sandai.net
# 121.9.209.196   hub5pr.sandai.net
118.89.55.235 www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com
 127.0.0.1   www.baidu.com


tomcat 配置文件CONF中server.xml增加如下文件:


  </Host>
      <Host name="www.baidu.com"  appBase="mywebapps"
            unpackWARs="true" autoDeploy="true">
 </Host>

网址输入http://www.baidu.com却打不开,折腾很久,也无果
后来无意发现,在WIN10,需要注销后或重启,好像又可以了,可能内存的原因,tomcat及系统都要重启才可以吧


本文由【waitig】发表在等英博客
本文固定链接:win10下修改host后仍无法打开本地网页原因
欢迎关注本站官方公众号,每日都有干货分享!
等英博客官方公众号
点赞 (0)分享 (0)