• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

How to make Tomcat and Apache cooperate?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, There is a problem occurred when I tried to make Tomcat and Apache work together.
I have both Tomcat and Apache installed on my desktop, an additional helper
software(Jakarta Tomcat connecter) is also installed which connects Apache with Tomcat.
When there is a static html page, apache handles it, and when there is a JSP page apache passes it over to Tomcat.


When I use port 80(Apache):
It works perfectly when it processes JSP pages, but it just can not process servlets.

This is the configuration I added to Apache httpd.conf








anybody could possibly tell me why?
or should I change line:JkMount /servlet/* ajp13
to something else?
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Yichuan Wang:
When there is a static html page, apache handles it, and when there is a JSP page apache passes it over to Tomcat.


Why bother? Save yourself a ton of headaches and just let Tomcat serve everything.

Is there a reason you want to use Apache?
 
Yichuan Wang
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bear Bibeault:

Why bother? Save yourself a ton of headaches and just let Tomcat serve everything.

Is there a reason you want to use Apache?


well, for solely test purpose , it is true that only Tomcat is sufficient. but don't most of ISP providers use Apache+Tomcat on their servers? If they do, why not we,
My question is that is it worth to do it?
 
Bear Bibeault
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can think of no reason to do this if you don't need Apache to do something that Tomcat cannot do.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Yichuan Wang:
My question is that is it worth to do it?



It used to be.
The earlier versions of Tomcat were not optimized for performance.

In the last few years enhancements in both Tomcat and the JVMs on which they run have improved so much that, depending on what your app does, running Tomcat as a standalone may actually be faster than connecting it to an external webserver.

Very recently, Tomcat has gained the ability to run with the Apache Portable Runtime libraries (APR) The APR is the core of the Apache Web Server, is written in C and can take advantage of things like kernel level file serving and kernel level socket handling.

My advice, try running with a standalone version of Tomcat.
If your app is suffering from performance problems look into all of the available means to improve it, including APR and running Tomcat behind and external web server.

Often, Tomcat's static file handling or SSL handling won't be your biggest bottleneck so adding and maintaining an external web server, and the connector (with all of its headaches) will gain you nothing. The cost of installing, configuring, and maintaining it may be more than what it would cost to improve your hardware or pay for a better network connection.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also...
If you find a book or article on the web that advocates running Tomcat behind an external web server, check the date carefully. The arguments may have been very valid at the time that it was written.

A lot has changed.
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's very perfect as Ben said. The recent versions of Tomcat have undergone certain improvements in performance.

So the later versions are well suited to sustain the earlier bottlenecks.
 
Eat that pie! EAT IT! Now read this tiny ad. READ IT!
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic