配置了tomcat,更改了默认端口为8070,还是访问不了
2014-03-17 10:54
387 查看
配置了tomcat,更改了默认端口为8070,还是访问不了
公司的运维帅哥说是防火墙没有设置白名单
查看防火墙设置:
[root@VDC-032 bin]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
直接修改iptables文件:
vim /etc/sysconfig/iptables
加入-A INPUT -p tcp -m state --state NEW -m tcp --dport 8070 -j ACCEPT
iptables文件内容如下:
[root@WXG-002-V3 bin]# more /etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Mon Mar 17 10:34:01 2014
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [32:3184]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8070 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A INPUT -p tcp -m tcp --dport 8070 -j ACCEPT
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
或者使用命令行方式设置:
# iptables -A INPUT -p tcp --dport 8070 -j ACCPET
#service iptables save
设置完成后重启iptables service
service iptables restart
还有一种方法,就是不清空防火墙(运维的说法是关闭防火墙)
iptables -F
公司的运维帅哥说是防火墙没有设置白名单
查看防火墙设置:
[root@VDC-032 bin]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
直接修改iptables文件:
vim /etc/sysconfig/iptables
加入-A INPUT -p tcp -m state --state NEW -m tcp --dport 8070 -j ACCEPT
iptables文件内容如下:
[root@WXG-002-V3 bin]# more /etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Mon Mar 17 10:34:01 2014
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [32:3184]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8070 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A INPUT -p tcp -m tcp --dport 8070 -j ACCEPT
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
或者使用命令行方式设置:
# iptables -A INPUT -p tcp --dport 8070 -j ACCPET
#service iptables save
设置完成后重启iptables service
service iptables restart
还有一种方法,就是不清空防火墙(运维的说法是关闭防火墙)
iptables -F
相关文章推荐
- angular2 使用更改默认端口,并配置proxy.config.json进行跨域访问
- [Tomcat]配置默认访问端口及Tomcat默认访问项目
- Tomcat中更改默认端口、更改默认根目录、更改默认页的配置方法
- redhat7下配置tomcat7,更改端口8080后无法访问页面
- 如何在tomcat里为多个应用配置不同的访问端口
- TOMCAT下配置工程的默认访问
- 在TOMCAT下配置工程的默认访问
- tomcat6.0 配置不同端口访问不同项目
- 一个Tomcat 多项目配置不同端口 有一个访问不了404,web项目配置webAppRootKey
- 在TOMCAT下配置工程的默认访问
- spring boot内嵌tomcat配置端口更改
- 协合系统前后台启动正常,却连不上,可能是tomcat的端口配置不正确额 协合默认为80端口 请检查
- CentOS自带mysql配置(密码更改、端口开放访问、添加进系统启动项)
- 如何在tomcat里为多个应用配置不同的访问端口
- tomcat 配置默认访问
- tomcat配置默认访问工程目录
- 有关Tomcat应用程序目录、端口、默认目录、应用程序默认打开文件、使用数据库连接池等方面的配置
- tomcat默认访问的项目(域名直接访问项目,不带端口)
- spring boot内嵌tomcat配置端口更改
- 更改Tomcat默认目录、端口、文件名 - 睡醒的狮子