我正在尝试在CentOS环境中部署Tomcat服务器,但它没有收到请求.
原文链接:https://www.f2er.com/centos/373992.html执行startup.sh工作正常,日志显示tomcat正在运行
16-Dec-2016 13:36:58.440 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-8080] 16-Dec-2016 13:36:58.444 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [ajp-nio-8009] 16-Dec-2016 13:36:58.445 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 14803 ms
运行netstat检查侦听端口时,它显示为侦听
$netstat -atnp|grep LISTEN tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 3321/java
$iptables -nL Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:50060 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:50030 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:50105 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:50090 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:50075 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:50070 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:123 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
我在顶部添加了规则,以避免在一般拒绝后添加错误.服务返回以下内容时,Iptables处于活动状态:
$service iptables status Redirecting to /bin/systemctl status iptables.service ● iptables.service - IPv4 firewall with iptables Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled) Active: active (exited) since Fri 2016-12-16 13:09:47 EST; 1h 45min ago Main PID: 728 (code=exited,status=0/SUCCESS) CGroup: /system.slice/iptables.service
但是,请求未到达Tomcat,因为localhost访问日志为空.
Firewalld不会干扰连接,因为它声称被禁用:
$firewall-cmd --state not running
我还缺少其他防火墙设置吗?