Port forwarding (through 2 routers) to raspberry pi tomcat
I have a raspberry pi, and I set up apache and tomcat and ssh. I can connect to all of them with the local IP address: 192.168.1.121:80, 192.168.1.121:8080, 192.168.1.121:22 with no problem.
I set static ip to the pi and to the second router too. I set port forwarding on the second router for 80, 8080 and 22 ports to the pi, and on the first router to the second router (same ports).
I use the noip client to refresh the dynamic dns service. I can reach the ssh and the apache, but I can't the tomcat. So I can connect to the mydomain.no-ip.info and the mydomain.no-ip.info:22 but I can't to the mydomain.no-ip.info:8080.
I think it's strange, because all of them should work or none of them... What can be the problem?
UPDATE: I found in the /etc/tomcat7/server.xml file two possible wrong settings:
... <Engine name="Catalina" defaultHost="localhost"> ... <Host name ="localhost" ... >
Should I change one of (or both of) the localhost to mydomain.no-ip.info?
UPDATE2: If I change the Host to mydomain.no-ip.info I get an empty page for 192.168.1.121:8080, and error for mydomain.no-ip.info:8080. If I change both the 192.168.1.121:8080 is working, but the domain:8080 still not.
UPDATE3: I scanned the 8080 port with this tool: http://www.whatsmyip.org/port-scanner/ and it says it's open. So I think my ISP is not blocking the 8080 port (ok, if 80 is not blocked, the 8080 has a little chance to be blocked)
no-ip.info probably blocks port 8080. Try connecting with your external ip directly.
With nmap I did some port scan, and I see that the 192.168.0.1 (first router) 8080 port is closed. It's strange, because the external ip's 8080 port is open (see update3).
I changed the tomcat port to 8181, set the forwarding on both routers, and it's working with mydomain.no-ip.info:8181
It's working now, but an explanation is welcomed.