首页 新闻 搜索 专区 学院

求助:用localhost不能访问IIS7 用127.0.0.1却能访问

0
悬赏园豆:10 [已解决问题] 解决于 2011-06-27 09:52

Win7的系统,昨天晚上都还好好的,今天早上就不行了。

问题是这样出现的:当我打开vs2010调试web项目时,浏览器就是一个白板,网页出不来,而且CPU占用100%,当时我还以为是项目的问题,当我打开一个新的项目再进行调试的时候,还是同样的症状。

于是我想到可能是IIS的问题,当我在浏览器地址栏输入:http://localhost的时候,本以为可以看见熟悉的IIS7界面,但是我没有看见,而是面临同样的问题——网页白板,CPU占用100%。

我又弄了好久,发现用127.0.0.1能正常访问上去,但是用localhost还是不行,一访问CPU就100%,电脑就直接卡死了。

我重装了IIS,还是不行,有没有谁遇到过这样的情况,各位大虾帮帮忙,小弟感激不进。

问题补充:

下面是我的hosts文件

# 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

逊王之王的主页 逊王之王 | 初学一级 | 园豆:9
提问于:2011-06-22 13:19
< >
分享
最佳答案
0

查看host文件是否正确

收获园豆:10
慧☆星 | 大侠五级 |园豆:5533 | 2011-06-22 16:22
您能告诉我怎么查看吗
逊王之王 | 园豆:9 (初学一级) | 2011-06-22 16:24
http://baike.baidu.com/view/493742.html?fromTaglist
慧☆星 | 园豆:5533 (大侠五级) | 2011-06-22 16:26
貌似正确
逊王之王 | 园豆:9 (初学一级) | 2011-06-22 16:54
你是不是添加什么网络协议,修改什么属性了
慧☆星 | 园豆:5533 (大侠五级) | 2011-06-22 16:56
什么都没改,好奇怪哦,用http://localhost就连进iis7的欢迎界面都不行,但是用http://127.0.0.1就一切正常
逊王之王 | 园豆:9 (初学一级) | 2011-06-23 09:11
把你的host文件贴出来看看
慧☆星 | 园豆:5533 (大侠五级) | 2011-06-23 14:18
# 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
逊王之王 | 园豆:9 (初学一级) | 2011-06-24 09:10
# 127.0.0.1 localhost
# ::1 localhost
前边的井号去掉
127.0.0.1 localhost
::1 localhost
慧☆星 | 园豆:5533 (大侠五级) | 2011-06-24 09:39
去了,不行啊,貌似Win7都有这个#号,而且好像跟#号没关系嘛,因为127.0.0.1可以访问。
逊王之王 | 园豆:9 (初学一级) | 2011-06-27 09:44
问题解决了:
# 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
127.0.0.1 localhost
localhost 127.0.0.1

谢谢您耐心的帮助我!
逊王之王 | 园豆:9 (初学一级) | 2011-06-27 09:51
http://topic.csdn.net/u/20110622/13/5f4d957d-cf3a-4cee-bb82-28a6c6990647.html?seed=991563192&r=74064395#r_74064395
逊王之王 | 园豆:9 (初学一级) | 2011-06-27 09:55
其他回答(2)
0

iis设置下,不分配ip就是localhost

青牛客 | 园豆:562 (小虾三级) | 2011-06-22 13:44
以前都没遇到过,我也没动过iis,您能告诉我怎么设置iis吗
支持(0) 反对(0) 逊王之王 | 园豆:9 (初学一级) | 2011-06-22 13:49
0

谢谢老大。。。。。我也遇到了同样的问题。。。。现在解决了。。。。感谢各位。。。。

羽商宫 | 园豆:2490 (老鸟四级) | 2012-07-28 23:20
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册