1、打开Internert信息管理查看IIS是否启动,且默认网站时候已经开启;
2、打开http://127.0.0.1 看是否能访问IIS的默认网页,能访问则说明IIS已经成功安装到电脑上,可能是无法解析localhost;
3、开始--命令(cmd)--ping localhost,看是否能ping通,从127.0.0.1上返回信息,如果成功则说明可以解析localhost;
4、如果上一步不成功,则用记事本打开C:/WINDOWS/system32/drivers/etc/hosts文件,看里面是否有包含:127.0.0.1 localhost ,如果没有则将其添加进去,再查看能否访问localhost。
5、尝试将网站的主目录指向另一个目录或新建一个虚拟目录,并在该新目录创建一个新的网页文件,如index.html,然后将其加到默认网站的"文档"项中作为默认访问的网页,重新输入网址:http://localhost,看否能访问。
6、还是不行的话将IIS卸载掉,重新再安装一次。
还有一种情况也会导致"无法访问localhost, 但可以访问127.0.0.1",这是我所遇到的,返回的信息如下:
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.
--------------------------------------------------------------------------------
Please try the following:
Click the Refresh button, or try again later.
Open the Web site home page, and then look for links to the information you want.
If you believe you should be able to view this directory or page, please contact the Web site administrator by using the e-mail address or phone number listed on the Web site home page.
10061 - Connection refused
Internet Security and Acceleration Server
--------------------------------------------------------------------------------
Technical Information (for support personnel)
Background:
The server you are attempting to access has refused the connection with the gateway. This usually results from trying to connect to a service that is inactive on the server.
ISA Server: XWProxy1.star-net.cn
Via:
Time: 2008-10-14 0:50:36 GMT
这是因为我所在部门的电脑只能通过局域网内主机做代理服务器来访问网络,在设置代理服务器的时候,未将"对于本地址不使用代理服务器(B)"打钩,导致访问本地地址的时候也实验代理服务器,localhost只能被本地主机解析,代理服务器不能解析其他主机的localhost。只要将 Internet选项--链接--局域网设置--代理服务器 下的那个√打上就可以了。