Monday, 21 March 2016

Why to connect HTTPD and Tomcat togather ?


One of the most common reasons to connect the two servers was to allow HTTPD to serve static content, freeing up Tomcat to process dynamic requests.

Additional benefits are :
Clustering, Load Balancing, and Security
HTTPD and mod_jk can be used to balance server load across multiple Tomcat instances, or divide Tomcat instances into various namespaces, managed by HTTPD.

Apache HTTPD Modules and Extensions
Number of modules that are available to extend its functionality is staggering.  It need CGI ?
Adding it to Apache is just a matter of installing downloading and installing a single module.
Apache also can handle many different "decorations" - rewrites of headers, URLs, and more. 

Socket Error Handling
Unlike Tomcat, Apache HTTPD can run natively on a system, rather than within a cross-platform JVM.  For this reason, HTTPD has an advantage when it comes to handling socket errors (i.e. dropped/invalid connections, invalid IPs, etc), as socket optimization practices differ significantly from operating system to operating system.

Security
Tomcat and HTTPD are different projects, but in some areas - security, for example - their functionality overlaps.  In these cases, some users may decide to delegate these tasks to HTTPD.
In fact, according to Apache, there has never been a reported case of data loss or damage due to a malicious attack on a Tomcat instance - not even one. Ultimately, the decision to use HTTPD to handle security should be based on your specific use scenario.  If you are facing a problem that has no existing solution in the Tomcat community, but has already been solved by the Apache HTTPD community, there's no reason not to integrate HTTPD into your toolkit.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.