• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

2 Tomcat Server One Internal One External

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have a big problem.
Please watch my attached picture to see what i mean.
I have website there is a calculator its form with fields.
I send this form via jquery(ajax) to the web server because my second tomcat server is not visible in the internet but there is my rule engine that creates all the rule for this calculator.
So I need to Talk from one tomcat to an other one where on is visible in the internet and one not.
How to solve this Problem?

Hope you know what I mean!

Lars
serverstructure.png
[Thumbnail for serverstructure.png]
What I mean
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This can go in a couple of directions.

I don't actually recommend connecting Tomcat directly to the Internet. In order to work with the standard HTTP and HTTPS ports (80 and 443), Tomcat must run as a privileged user, which is a security exposure. Better to use a safer proxy such as Apache httpd and have all the Tomcat stuff internal. So ideally, all of the code you need could then be in a single webapp internally, proxied via Apache or Squid or something.

That's probably not possible without major surgery on the apps. So the next best thing is to set up a communications channel between the webapps. The most flexible option would be to have the first app make web services calls to the second app. However, since you're on an internal network, where you can use certain mechanisms that are difficult-to-impossible to use on the open Internet. The 2 most likely candidates for me would be RMI or EJB (and EJB is basically an extension of RMI).

Tomcat doesn't implement either EJB or RMI natively the way full-stack servers such as JBoss do, but you can add such functionality to individual applications by incorporating the right libraries.

Another option is available if you haven't coded yourself specifically into a webapp architecture, and that's to replace the internal Tomcat's functions with a standard RMI server. If you don't actually need all the functionality of a web server, that can make things a little more lightweight. I used to work with a system that had the primary webapp offload long-running tasks to an RMI service.
 
He repaced his skull with glass. So you can see his brain. Kinda like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic