localhost可以访问,127.0.0.1和IP无法访问

Droy`Z 2013-01-10 06:32:31
最近部署一个成熟web项目在windows2003服务器上,部署完成后启动tomcat服务,没有报错,输入http://localhost:8088/portal访问正常,但是通过http://127.0.0.1:8088/portal和http://10.1.0.8:8088/portal访问就只能看见登录页面,但是点击登录只是刷新下登录页面并没有执行登录进入到主页面。
web项目已经使用多年,所以应该没什么问题。
服务器安装的是windows2003操作系统,oracle10g数据库,tomcat服务。
操作系统的防火墙已经关闭,杀毒软件神马的都关闭了,。
使用命令查看端口情况


装有一个不知道是什么东东的

...全文
7171 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
suciver 2013-01-11
  • 打赏
  • 举报
回复
引用 4 楼 brightyq 的回复:
看有没有设置localhost和127.0.0.1的对应,在C:/WINDOWS/system32/drivers/etc/hosts文件 看里面是否有包含:127.0.0.1 localhost,没有的话加上;如果前面有‘#’,把它去掉 另外看看程序里有没有控制,只允许输localhost访问,不允许输IP地址?
+1
fw347969680 2013-01-11
  • 打赏
  • 举报
回复
学习了。
andy_swc 2013-01-11
  • 打赏
  • 举报
回复
EverWHL 2013-01-11
  • 打赏
  • 举报
回复
应是host文件设置问题 请查看host文件设置,具体怎么设置可以查看百度
熊猫大虾 2013-01-11
  • 打赏
  • 举报
回复
引用 4 楼 brightyq 的回复:
看有没有设置localhost和127.0.0.1的对应,在C:/WINDOWS/system32/drivers/etc/hosts文件 看里面是否有包含:127.0.0.1 localhost,没有的话加上;如果前面有‘#’,把它去掉 另外看看程序里有没有控制,只允许输localhost访问,不允许输IP地址?
以前也遇到过,受教了
brightyq 2013-01-10
  • 打赏
  • 举报
回复 1
看有没有设置localhost和127.0.0.1的对应,在C:/WINDOWS/system32/drivers/etc/hosts文件 看里面是否有包含:127.0.0.1 localhost,没有的话加上;如果前面有‘#’,把它去掉 另外看看程序里有没有控制,只允许输localhost访问,不允许输IP地址?
猪公公 2013-01-10
  • 打赏
  • 举报
回复
你查看hosts 文件 C:\Windows\System32\drivers\etc\hosts
看看里面有没有配置:

# 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 这行数据
xub2562250 2013-01-10
  • 打赏
  • 举报
回复
哦 对了 如果是ipv6 的原因 ,不一定必须删除ipv6 在系统设置中 可以设置127.0.0.1,在书上看到过~ 想不起来了。。。你先试试吧~
xub2562250 2013-01-10
  • 打赏
  • 举报
回复
现在大多都安装了ipv6 ,我没说错的话 应该是 ipv6 的原因,127.0.0.1 = ::1 (貌似是这样), 你试一下 如果可以访问 那你需要卸载ipv6,具体的你可以百度看看 忘了。。。

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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