码迷,mamicode.com
首页 > 其他好文 > 详细

CenOS下Tomcat外网不能访问

时间:2014-06-28 13:00:09      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   java   color   get   

今天在CentOS下部署了一个Tomcat,启动没问题,但是外网不能访问,检查知防火墙开了。

1.检查防火墙是否开启,执行

/etc/init.d/iptables status

如果有下面结果,表示防火墙开启。

[root@yyl bin]# /etc/init.d/iptables status
表格:filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
5 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

 

2.关闭防火墙

/etc/init.d/iptables stop

 然后Tomcat就能访问了。

 

 

CenOS下Tomcat外网不能访问,布布扣,bubuko.com

CenOS下Tomcat外网不能访问

标签:des   style   blog   java   color   get   

原文地址:http://www.cnblogs.com/baby-bear/p/3798706.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!