This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi! I'm trying to set up a server to run on my home computer. I have TomEE up and running, the servlet's working fine when accessed through my localhost. However, when I try to access the servlet through my IP address or my hostname, I get an Unable to Connect error. My router is set up to port forward. I have purchased a domain name and I'm using http://freedns.afraid.org to support my domain name. What am I missing?
A couple of possibilities -
1) your firewall is blocking the traffic,
2) your router is like mine and will not route to my external IP address from my local area network. To test this just use a machine outside of your local area network to access your site. For development purposes I fool the router by going through an external proxy.
Joined: Dec 24, 2012
Unfortunately no luck on either front. I don't have a firewall running and I can't access the site from outside of my local area network. I called my registrar and they were able to determine that it's a problem on my machine, but with registration or with my dynamic DNS host. So we're able to narrow down the problem but still not luck with resolution.
All help is appreciated.
Trying <the host ip here>...
telnet: Unable to connect to remote host: Network is unreachable
That effectively means that this issue is related to your network settings and hasn't got anything to do with TomEE. That's what my initial thought was but I wanted to make sure that I wasn't taking a guess. So at this point you'll have to figure out why the server isn't accessible from that machine. Which OS is the server machine? Depending on that there are different ways to try and figure out why the server may not be accessible.
Joined: Dec 24, 2012
I'm running ubuntu.
I think my problem is with iptables. My rules are as follows:
sudo iptables -F
sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --sport 80 -j ACCEPT
sudo iptables -A INPUT -p udp --sport 53 -j ACCEPT
sudo iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 8443 -j ACCEPT
sudo iptables -A OUTPUT -j ACCEPT
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080