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

Tomcat Connector configurations

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is what I'm trying to do... From the outside, the IP goes to a WEB server that has IIS and tomcat connector on it, then the tomcat connector sends it back to the APP server that has the actual Tomcat running. On the tomcat we have 2 seperate instances of tomcat running. By seperate instances I mean 2 different tomcat 5.5 directories that have been renames. We did it this way because one of the instances we will have to restart once, or twice per month for updates, the other pretty much stays as is. One instance is our corporate website to the outside, the other instance is a web portal with a sign-in. The corporate instance runs out of the ROOT directory, the web portal runs out of a directory names PPA.

Here is my uriworker.properties file
/ppa|/*=worker1
/*=worker2
!/ppa|/*=worker2

workers.properties
workers.tomcat_home=C:\PPA
workers.tomcat_home=C:\worker2 (I have one of these two commented out depending what conf. folder it is in on the APP server)
works.java_home=c:\program files\java\jdk1.6.0_07
worker.list=worker1,worker2
worker.worker1.host=ip address
worker.worker1.port=8040
worker.worker1.type=ajp13
worker.worker2.host=ip address
worker.worker2.port=8009
worker.worker2.type=ajp13

I can get these to work one at a time fine, when I put them together I can only get the corparte site which is in ROOT to come up fine, the other one I get a:

Page cannot be found HTTP error 404.

Anyone have any suggestions?

 
Saloon Keeper
Posts: 24810
172
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
More technically, Apache is forwarding selected requests down the ajp connector to the Tomcats.

I haven't dissected your worker definitions in detail, and as I understand it, the goal in the not-too-distant future is that ajp will be pretty much replaced by apache mod_proxy. But the forwarding mechanism is pretty straightforward as long as you make sure that you do the proper pattern-matching and in the proper order so that there won't be any conflicts/ambiguities.

As I recall, however, when you have multiple actions applied against a URL in Apache (and in your case that would be between the Apache-only and Tomcat URLS), results can be confusing and more than a little maddening. I seem to recall collecting a few bruises in that regard using mod_rewrite.

I think that Apache2 addressed some of those ambiguities and made them more deterministic (hence, predictable), but I haven't looked at that in detail, either.

You best bet is to craft URLs that don't overlap. For example, I have a site that proxies all the Subversion stuff under "/svn/".

Trying to simply map "/" is really asking for trouble. Better to leave that to the default Apache app.
 
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you have a chance to look at Tomcat Connector log file?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic