I have a Tomcat 7 server running on a CentOS6 VM (bridged network mode, we'll say the IP is 1.2.3.4
) and am trying (and unable) to access it from the host machine. I can access the resource test
(a file containing "Hello, world!") from the VM with
# wget 1.2.3.4:8080/test/
...and it comes down fine. If I try the same command from the host, either it fails (connection refused), or it connects and then spits out a
Read error (Connection reset by peer) in headers.
Retrying.
It will try once or twice more, with the last one being "connection refused".
When the connection is refused, nothing shows up in the access log. When I get a read error, the request shows up in the access log with a response code of 200. Which response I get switches back and forth intermittently.
This is the connector for 8080 in server.xml:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
The fact that Tomcat sees any of the requests from the host makes me pretty sure it's not the firewall, but here's the VM's iptables file:
# Generated by iptables-save v1.4.7 on Wed May 7 10:27:30 2014
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s 1.2.3.0/24 -p tcp -m tcp --dport 8080 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
COMMIT
# Completed on Wed May 7 10:27:30 2014
Is there a server configuration I'm missing, or something that might be causing the inconsistencies in the responses?