• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Tomcat as proxy server?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am using Jakarta Tomcat 5.0.28 as my webserver for "MyApp" in "MyCompany". It handles some static content, some applets, some servlets and some jsp - for normal users of internet.

A challenge arises:

"MyApp" now needs to show webpages that reside on another server, "OtherApp" (ASP running on MS IIS 6.0), but still in the same company. Normally "MyApp" would just open a new browser window with URL of "OtherApp" - BUT: "OtherApp"'s server is not accessible from internet; it is only accessible from servers within "MyCompany"'s domain.

"MyApp" can communicate with "OtherApp", internet-users can communicate with "MyApp", but internet-users cannot communicate with "OtherApp".

"Proxy" rings a bell, for example that all requests to:
www.mycompany.com/myapp/otherapp/* will be routed to "OtherApp". As far as I know, Tomcat doesn't have this kind of proxy-ability.

I tried Tomcat's balancer-application, but it seemingly only redirects the request to "OtherApp", so internet-user communicates directly with "OtherApp" which isn't possible.

Is it possible to set up Tomcat to be a proxy server the way I want? Or do I need Apache webserver too, and would that be an easy set-up?

Is another possibility creating a servlet to act as a proxy? Does this exist already for download? Is it feasible even when "OtherApp" has dynamic content with forms and choices?

Any help would be greatly appreciated!
 
Rancher
Posts: 43045
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Since the effect of this would be to open up OtherApp to the Internet anyway, why not make that change on the network level, and make OtherApp accessible to the outside directly?

If you're set on proxying, check out the Apache mod_rewrite module.
 
Mis Visning
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, and thanks for your reply.

The OtherApp-server unfortunately does more than just the webpages I'm trying to get MyApp's users to access. And I have no control over the OtherApp-server, so it's not up to me to make it available on internet (and afraid the people responsible would disallow that anyway).

Ok, mod_rewrite, but that's only Apache and not Tomcat, right? Since MyApp is already running on just Tomcat, a solution using just Tomcat would be preferable, but if Apache is the only way ...
 
Mis Visning
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anyone else?
 
Marshal
Posts: 4084
554
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mis Visning wrote:... if Apache is the only way ...


It is not the only way, but is probably the best way.
 
Saloon Keeper
Posts: 26538
187
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 thread was raised from the dead by a spammer who has since been banned. There's no one listening anymore.

Except me.
 
Ron McLeod
Marshal
Posts: 4084
554
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for letting me know - I didn't notice that it was from 8 years ago.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic