• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat and Apache.

 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have seen that many webapplication running in tomcat are accessed through apache.Our request first goes to apache and then routed to tomcat using mod_jk .What is the advantage of such configuration?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a number of things Apache can do that Tomcat can't. E.g., running PHP or other non-Java server programs, or using the multitude of modules that enhance Apache in other ways.

In days past it used to be that people used Tomcat purely for servlets/JSP, and let Apache handle the static content, but Tomcat has become much faster at serving static content since then, so that alone is no longer a good reason to use Apache in addition to Tomcat.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf for your reply.
If in my web application there are some php's (and want the php's to be processed by apache) ,so for this any special configuration is required to be done apart from mod_jk.

For this do I have to deploy one application with php's in apache and other with the same context name in tomcat for servlets.
 
Neerav Narielwala
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Installing Tomcat itself is in fact also quite straightforward (Again, the docs are quite complete), but it's when you want it to access it through Apache that things get a little more complicated.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Neerav Narielwala:
but it's when you want it to access it through Apache that things get a little more complicated.



that is very true , but what is the advantage of such configuration?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but what is the advantage of such configuration?

You can only have one server listening on port 80, so assuming that you don't want Tomcat to use a different port, you need to channel the Tomcat requests through Apache.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic