aspose file tools*
The moose likes Tomcat and the fly likes Tomcat and Apache. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat and Apache." Watch "Tomcat and Apache." New topic
Author

Tomcat and Apache.

Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
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?


Rahul Bhattacharjee
LinkedIn - Blog
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41572
    
  54
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.


Ping & DNS - my free Android networking tools app
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
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

Joined: Dec 08, 2006
Posts: 106
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.


<a href="http://www.java-tips.org/java-tutorials/tutorials/" target="_blank" rel="nofollow">Java Tutorials</a> | <a href="http://www.planet-java.org" target="_blank" rel="nofollow">Java Weblog</a> | <a href="http://computer-engineering.science-tips.org" target="_blank" rel="nofollow">Computing Articles</a>
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
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
Marshal

Joined: Mar 22, 2005
Posts: 41572
    
  54
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tomcat and Apache.