localhost能访问而用127.0.0.1和本地ip不能访问

绿旅嗒 2010-11-26 04:50:18
tomcat5.5部署一工程,localhost能访问,而用127.0.0.1和本地ip不能访问,报404。
...全文
1129 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
sunnylonglong 2010-11-28
  • 打赏
  • 举报
回复
用本地IP地址也不行吗?
shanxmxj 2010-11-27
  • 打赏
  • 举报
回复
[Quote=引用 17 楼 lyylkj12 的回复:]
现在是返回127.0.0.1了,重启了下
[/Quote]

那现在可以访问了么??
绿旅嗒 2010-11-26
  • 打赏
  • 举报
回复
现在是返回127.0.0.1了,重启了下
绿旅嗒 2010-11-26
  • 打赏
  • 举报
回复
删了啊,它还是这个
shanxmxj 2010-11-26
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 shanxmxj 的回复:]
#::1localhost
把这个删掉
再试
[/Quote]

这个试了么?
绿旅嗒 2010-11-26
  • 打赏
  • 举报
回复
C:\Users\Administrator>ping localhost

正在 Ping PC-20101110LIXL [::1] 具有 32 字节的数据:
来自 ::1 的回复: 时间<1ms
来自 ::1 的回复: 时间<1ms
来自 ::1 的回复: 时间<1ms
来自 ::1 的回复: 时间<1ms

::1 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms

shanxmxj 2010-11-26
  • 打赏
  • 举报
回复
ping 一下localhost 看解析出来的地址是什么

正常的话 应该是127.0.0.1
shanxmxj 2010-11-26
  • 打赏
  • 举报
回复
#::1localhost
把这个删掉
再试
绿旅嗒 2010-11-26
  • 打赏
  • 举报
回复
http://127.0.0.1:8080/
结果:
Your server is up and running!

怎么就是不能访问到工程
绿旅嗒 2010-11-26
  • 打赏
  • 举报
回复
修改了,没用。http://127.0.0.1能访问IIS的默认网页 ping也是行的。就是报404,是不是tomcat问题
zidasine 2010-11-26
  • 打赏
  • 举报
回复
去修改host 文件
绿旅嗒 2010-11-26
  • 打赏
  • 举报
回复
哦,谢谢,我试试
shanxmxj 2010-11-26
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 lyylkj12 的回复:]
# 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 sho……
[/Quote]
#127.0.0.1 localhost
你注释掉了啊 把#号去掉
绿旅嗒 2010-11-26
  • 打赏
  • 举报
回复
用http://192.168.1.249:8080/ACG/ 也不行
绿旅嗒 2010-11-26
  • 打赏
  • 举报
回复
# 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

已经有了
shanxmxj 2010-11-26
  • 打赏
  • 举报
回复
在host文件里 添加一行
127.0.0.1 localhost 试试看
绿旅嗒 2010-11-26
  • 打赏
  • 举报
回复
哪位仁兄指点下啊!
绿旅嗒 2010-11-26
  • 打赏
  • 举报
回复
能说清楚点吗?为什么用localhost可以的
wangwz504 2010-11-26
  • 打赏
  • 举报
回复
你要跟应用上下文地址才行。

67,512

社区成员

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

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