[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Can't access Tomcat using public IP address

Posted on 2013-11-27
5
Medium Priority
?
5,460 Views
Last Modified: 2013-11-28
Hi,

I can access my website using the public IP of "http://192.232.254.240:80", no problem.
I've installed and started Tomcat on my server.
I can SSH in to my server and use lynx to view "http://localhost:8080". The Tomcat admin page is displayed.
But I can't access "http://192.232.254.240:8080" from my browser.
Executing "netstat -nap" on my server produces the following...
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      869/httpd
tcp        0      0 :::80                       :::*                        LISTEN      869/httpd
tcp        0      0 :::8080                     :::*                        LISTEN      32767/java

Open in new window

Note that I only copied rows related to 80 and 8080.
Is the reason why I can't access "http://192.232.254.240:8080" is because there's no "0 0.0.0.0:8080"?
How do I resolve this?
Thanks.
0
Comment
Question by:killdurst
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 19

Expert Comment

by:xterm
ID: 39682833
Yes, your installation is only listening on IPv6 port 8080 - you need to tell Java to prefer IPv4 so that Tomcat will be accessible on 0.0.0.0 rather than :::

This (among many other pages) describes the fix:
http://serverfault.com/questions/390840/how-does-one-get-tomcat-to-bind-to-ipv4-address
0
 
LVL 19

Accepted Solution

by:
xterm earned 2000 total points
ID: 39682836
More specifically, this snippet should get it done:

add: JAVA_OPTS= $JAVA_OPTS -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses to the catalina.sh startup
0
 
LVL 1

Author Comment

by:killdurst
ID: 39682858
Thanks! It works now!
0
 
LVL 19

Expert Comment

by:xterm
ID: 39682913
Glad to hear it, enjoy :)
0
 
LVL 19

Expert Comment

by:xterm
ID: 39682918
BTW, give yourself a pat on the back - your posting the output from netstat all but made it obvious what the problem was - had you not had that foresight to do so, you might've been battling a lot of speculation going down multiple other avenues before arriving at this simple fix...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses
Course of the Month14 days, 14 hours left to enroll

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question