• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make Tomcat and Apache cooperate?

 
Yichuan Wang
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64962
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64962
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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 Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic