localhost可以访问,但127.0.0.1不能访问?

w521111 2011-09-02 09:52:37
如题,服务在本地,http://localhost 可以访问,
但是 http://127.0.0.1 就不行,直接“无法显示该网页”
网络没问题,访问其他机器的服务也没问题,如http://192.168.0.135

有哪些原因可能导致这种情况?
...全文
9710 40 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
40 条回复
切换为时间正序
请发表友善的回复…
发表回复
w521111 2011-09-06
  • 打赏
  • 举报
回复
最后发现时tomcat问题,换了个安装版的就好了
不过具体问题出在哪还不清楚
BearKin 2011-09-02
  • 打赏
  • 举报
回复
如果整合了APACHE
请看这个
http://www.blueidea.com/computer/soft/2008/5966.asp
我感觉你的配置似乎有点问题
BearKin 2011-09-02
  • 打赏
  • 举报
回复
...LZ换过端口了么 LZ是不是整合了Apache 回答我..
BearKin 2011-09-02
  • 打赏
  • 举报
回复
[Quote=引用 36 楼 bayougeng 的回复:]
为什么localhost就理所当然的等于127.0.0.1?
tracert不是用来修复你的问题的,是让你看看结果,看127.0.0.1是经过什么样的网络路由到达。
localhost在清除cache之后也能打开?
[/Quote]

好久不见啊 香哥!

...目前觉得那个IPV6的解释最靠谱..
w521111 2011-09-02
  • 打赏
  • 举报
回复
catalina.log内容如下:


2011-9-2 2:52:01 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.20.
2011-9-2 2:52:01 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2011-9-2 2:52:01 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-80
2011-9-2 2:52:01 org.apache.coyote.ajp.AjpAprProtocol init
信息: Initializing Coyote AJP/1.3 on ajp-8009
2011-9-2 2:52:01 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1217 ms
2011-9-2 2:52:01 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2011-9-2 2:52:01 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/5.5.33
2011-9-2 2:52:01 org.apache.catalina.core.StandardHost start
信息: XML validation disabled
2011-9-2 2:52:03 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-80
2011-9-2 2:52:03 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2011-9-2 2:52:03 org.apache.catalina.storeconfig.StoreLoader load
信息: Find registry server-registry.xml at classpath resource
2011-9-2 2:52:03 org.apache.catalina.startup.Catalina start
信息: Server startup in 1389 ms
2011-9-2 2:52:38 org.apache.coyote.http11.Http11AprProtocol pause
信息: Pausing Coyote HTTP/1.1 on http-80
2011-9-2 2:52:39 org.apache.coyote.ajp.AjpAprProtocol pause
信息: Pausing Coyote AJP/1.3 on ajp-8009
2011-9-2 2:52:40 org.apache.catalina.core.StandardService stop
信息: Stopping service Catalina
2011-9-2 2:52:40 org.apache.coyote.http11.Http11AprProtocol destroy
信息: Stopping Coyote HTTP/1.1 on http-80
2011-9-2 2:52:41 org.apache.coyote.ajp.AjpAprProtocol destroy
信息: Stopping Coyote AJP/1.3 on ajp-8009
2011-9-2 2:55:04 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.20.
2011-9-2 2:55:04 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2011-9-2 2:55:04 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-80
2011-9-2 2:55:04 org.apache.coyote.ajp.AjpAprProtocol init
信息: Initializing Coyote AJP/1.3 on ajp-8009
2011-9-2 2:55:04 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1404 ms
2011-9-2 2:55:05 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2011-9-2 2:55:05 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/5.5.33
2011-9-2 2:55:05 org.apache.catalina.core.StandardHost start
信息: XML validation disabled
2011-9-2 2:55:08 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-80
2011-9-2 2:55:08 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2011-9-2 2:55:08 org.apache.catalina.storeconfig.StoreLoader load
信息: Find registry server-registry.xml at classpath resource
2011-9-2 2:55:08 org.apache.catalina.startup.Catalina start
信息: Server startup in 3557 ms
2011-9-2 3:02:54 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.20.
2011-9-2 3:02:54 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2011-9-2 3:02:54 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-80
2011-9-2 3:02:54 org.apache.coyote.ajp.AjpAprProtocol init
信息: Initializing Coyote AJP/1.3 on ajp-8009
2011-9-2 3:02:54 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 858 ms
2011-9-2 3:02:54 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2011-9-2 3:02:54 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/5.5.33
2011-9-2 3:02:54 org.apache.catalina.core.StandardHost start
信息: XML validation disabled
2011-9-2 3:02:56 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-80
2011-9-2 3:02:56 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2011-9-2 3:02:56 org.apache.catalina.storeconfig.StoreLoader load
信息: Find registry server-registry.xml at classpath resource
2011-9-2 3:02:56 org.apache.catalina.startup.Catalina start
信息: Server startup in 1372 ms
2011-9-2 3:10:46 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.20.
2011-9-2 3:10:46 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2011-9-2 3:10:46 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-80
2011-9-2 3:10:46 org.apache.coyote.ajp.AjpAprProtocol init
信息: Initializing Coyote AJP/1.3 on ajp-8009
2011-9-2 3:10:46 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 873 ms
2011-9-2 3:10:46 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2011-9-2 3:10:46 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/5.5.33
2011-9-2 3:10:46 org.apache.catalina.core.StandardHost start
信息: XML validation disabled
2011-9-2 3:10:48 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-80
2011-9-2 3:10:48 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2011-9-2 3:10:48 org.apache.catalina.storeconfig.StoreLoader load
信息: Find registry server-registry.xml at classpath resource
2011-9-2 3:10:48 org.apache.catalina.startup.Catalina start
信息: Server startup in 1420 ms
brightyq 2011-09-02
  • 打赏
  • 举报
回复
LZ如果是XP系统,查找C:\windows\system32\drivers\hosts文件。
如果是win7系统,查找C:\Windows\System32\drivers\etc\hosts文件。

看有没有设置对应关系:

# 127.0.0.1 localhost
w521111 2011-09-02
  • 打赏
  • 举报
回复
哎,防火墙关掉,入站规则开放全部端口还是不行
这里有个疑问,telnet服务和客户端全部打开,端口也都开放了,但telnet还是不通,不明白为什么



hosts文件把127.0.0.1 前面的#去掉后反而localhost也不能访问了

BearKin 2011-09-02
  • 打赏
  • 举报
回复
.....这跟host文件有什么关系啊 如果是localhost不能访问127.0.0.1能访问倒是应该看看host文件..

LZ换个端口看看 启动日志发下看看
镜花水月73 2011-09-02
  • 打赏
  • 举报
回复
如果host配置好了的,
那么就是你的tomcat禁用了IP访问
jboss是需要单独设置IP访问的
w521111 2011-09-02
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 yuanyu113 的回复:]
你telnet 127.0.0.1 80看通不通
[/Quote]


telnet 是不通的,但不知道怎么搞
牙痴 2011-09-02
  • 打赏
  • 举报
回复
# Copyright (c) 1993-1999 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

127.0.0.1 localhost
softroad 2011-09-02
  • 打赏
  • 举报
回复
ipconfig直接用自己的ip访问,要不就看看hosts文件,和tomcat server.xml
牙痴 2011-09-02
  • 打赏
  • 举报
回复
hosts 内容如下:

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost

怎么多了一个 ::1啊
w521111 2011-09-02
  • 打赏
  • 举报
回复
没用IIS,不关IIS的事啊
ShenShiuyu 2011-09-02
  • 打赏
  • 举报
回复
加上端口还是不行吗
sunxg99 2011-09-02
  • 打赏
  • 举报
回复
你的是IIS那个版本啊!
w521111 2011-09-02
  • 打赏
  • 举报
回复
win7专业版
ShenShiuyu 2011-09-02
  • 打赏
  • 举报
回复
1270.0.0.1:80
yuanyu113 2011-09-02
  • 打赏
  • 举报
回复
是在windows下还是linux下运行的
yuanyu113 2011-09-02
  • 打赏
  • 举报
回复
你telnet 127.0.0.1 80看通不通
加载更多回复(19)

67,543

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧