Apache HTTP server + Tomcat for WSA apps

Tarby777

Member
G'day folks,

Further to my previous thread about reliability problems with my 10.2b app that uses the WSA inside Tomcat, I've been speaking to the developers of the client side of the app, and they have proposed a config where Apache HTTP server is put in front of Tomcat to receive the HTTP traffic, calling Tomcat only for the web services. Apparently they run this config in their development environment and don't get any of the failures with web service calls that I see in my Tomcat-only environment.

As an aside, it seems that the problem is related to a piece of middleware that I have to use in the Tomcat environment, called Javabridge. I believe it provides the full PHP support that their Sencha code needs and Tomcat can't give on it's own, hence the idea of putting Apache HTTP server in front of Tomcat to replace Javabridge.

I'm wondering whether any of you have been down the Apache server + Tomcat route, and whether there is much work in getting Apache HTTP server to forward the web service calls to Tomcat. Thanks in advance for war stories & guidance...

Cheers,
Tarby
 

Stefan

Well-Known Member
Getting Apache HTTP server to pass calls on to Tomcat is amazingly easy - just add two lines or so to the apache config file and you're done (details should be on the Tomcat web pages).

Nothing like the hassle of getting IIS to pass its requests through to Tomcat.
 

Tarby777

Member
Thanks Stefan,

Would you mind sharing with me what those two lines are? ;)

I've done what I can from the Apache doco and am not there yet... it seems to be saying that I need to load the "mod_jk" connector, make several changes to httpd.conf, create a workers.properties file, and so on...

TIA
Tarby
 

Stefan

Well-Known Member
Would you mind sharing with me what those two lines are? ;)

From our installation manual (yes there are actually a few more lines involved ;-))

Apache HTTP server 2.2


  • download from http://httpd.apache.org/download.cgi (current version 2.2.17)
  • stop IIS if applicable
  • install (default <httpd> is c:\program files\apache software foundation\apache2.2)
  • test http://localhost
  • configure <httpd>\conf\httpd.conf
    • DocumentRoot
    • ScriptAlias
    • Alias

Apache Tomcat 5.5



Configure Apache HTTP server

To pass requests on port 80 from Apache HTTP Server to Apache Tomcat:


  • edit <httpd>\conf\httpd.conf and uncomment (remove #):
    • #LoadModule proxy_module modules/mod_proxy.so
    • #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  • add the following line to <httpd>\conf\httpd.conf
    • Include conf/extra/httpd-proxy_ajp.conf
  • create httd-proxy_ajp.conf (in <httpd>\conf\extra):
    • ProxyPass /wsa/ ajp://localhost:8009/wsa/
    • ProxyPass /servlets-examples/ ajp://localhost:8009/servlets-examples/
  • restart server
  • test http://localhost/servlets-examples/servlet/HelloWorldExample

Configure Web Services Adapter



Configure AppServer Internet Adapter


 

GregTomkins

Active Member
I know it's a year old but I found this post very helpful. Thank you Stefan!

FYI, I noticed this typo (httd -> httpd). The '_' vs '-' is not a typo; it just has to match the preceding 'Include':
  • httd-proxy_ajp.conf (in <httpd>\conf\extra):
Also, this step did not work, possibly because I used TC 6 instead of 5.5. The WSA test DID work so I think it's all good.
 

Stefan

Well-Known Member
Haha. Thanks for spotting the typo... now updated in our manual. :)

The URL for the servlet examples (if installed at all) was moved in Tomcat 6.0 to http://localhost:8080/examples/servlets/servlet/HelloWorldExample - the correct link can be found on the Tomcat start page at http://localhost:8080.

I had forgotten about this document and just last week or so configured pass thru from httpd to tomcat 6 for a development server using my google skills... and it was much easier (maybe due to CentOS already having some stuff pre-installed) - see http://www.openlogic.com/wazi/bid/2...-and-Apache-for-best-performance-and-features
 
Top