0

I have a server that is pingable from the public internet. I've just installed tomcat on 8080 port on this server. From the server itself I can see the main page come up when accessing http://localhost:8080 however, from the internet if I try http://myservername:8080 or http://myserverip:8080 it does not work.

What do I additionally need to do in order for this to be accessible from the public internet?

Omnipresent
  • 227
  • 2
  • 7
  • 13

2 Answers2

3

Per default CentOS has an iptables firewall running. For a quick check you can turn it off using "service iptables stop". Another place to have a look at is the server.conf from your Tomcat. Maybe it's only listening on your localhost interface.

Pascal Schmiel
  • 1,738
  • 12
  • 17
1

What do I additionally need to do

Are the pings actually coming back from a firewall in front of the server? You would need to forward port 8080 through to the server, and add firewall rules to allow the connection.

Is it a Windows server? Does Windows Firewall allow the connection?

Is it a Linux server? Does IPTables (firewall) allow the connection?

TessellatingHeckler
  • 5,726
  • 3
  • 26
  • 44
  • For the first point, check if the IP on your machine (`ifconfig`) is really public, it should coincide what you see browsing to http://www.whatismyip.com/ . If not, you are doing NAT, and you need to configure port-forwarding in your router. To check if it's iptables, a quick and dirty way is to stop iptables for a few seconds and check. – leonbloy Apr 26 '13 at 19:55
  • I turned off the iptables service and now I can access it from the public. Is there a way to just open port 8080? – Omnipresent Apr 27 '13 at 02:56
  • Yes. Add the right mystical incantation to just the right config file. This guide is for CentOS, and might help http://www.cyberciti.biz/faq/linux-web-server-firewall-tutorial/ (using method one, add just one of the lines to each file, and put 8080 instead of 80. Add them right by the existing lines for port 80) NB. where it says to restart the service with `service iptables start` that should probably be `service iptables restart`. – TessellatingHeckler Apr 27 '13 at 02:59