<?xml version="1.0" encoding="UTF-8"?>

<rss version='2.0' 
     xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
     xmlns:doap="http://usefulinc.com/ns/doap#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

    <channel>
        <!-- This XML Feed shows details for the page Tomcat-httpd-integration 
             and everything recently tagged Tomcat-httpd-integration -->
        <creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/
          </creativeCommons:license>
        <title>Tomcat-httpd-integration on SWiK</title>
		<link>http://swik.net/Tomcat-httpd-integration</link>
        <doap:name>Tomcat-httpd-integration</doap:name>
        <doap:description>&lt;p&gt;&lt;a class="wikilink" href="http://swik.net/Tomcat"&gt;Apache Tomcat&lt;/a&gt; is capable of serving as a &lt;a class="wikilink" href="http://swik.net/httpd"&gt;&lt;span class="caps"&gt;HTTP&lt;/span&gt;/HTTPS server&lt;/a&gt;, but &lt;a class="wikilink" href="http://swik.net/Apache"&gt;Apache httpd&lt;/a&gt; can be used as the front end for client requests as well. Listed are popular options for establishing this integration.&lt;/p&gt;


	&lt;p&gt;Options for connecting Apache to Tomcat&amp;#8217;s Servlet/JSP engine&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a class="wikilink" href="http://swik.net/mod_proxy"&gt;mod_proxy&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a class="wikilink" href="http://swik.net/mod_jk"&gt;mod_jk&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a class="wikilink" href="http://swik.net/mod_proxy_ajp"&gt;mod_proxy_ajp&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Each of these choices has its advantages and disadvantages.&lt;/p&gt;


	&lt;h2&gt;httpd mod_proxy and ProxyPass/ProxyReverse&lt;/h2&gt;


	&lt;p&gt;httpd mod_proxy and ProxyPass/ProxyReverse is a quick and easy way to connect httpd to Tomcat, but it is also the least flexible and least performant. Complex configurations can be created with mod_proxy and the associated mod_proxy_* modules, however it&amp;#8217;s not the best solution unless:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;There is only one Tomcat back-end instance&lt;/li&gt;
		&lt;li&gt;All that matters is the quickest possible time to setup&lt;/li&gt;
		&lt;li&gt;Using Apache httpd 2.2.x is not an option&lt;/li&gt;
		&lt;li&gt;Performance requirements are not a concern&lt;/li&gt;
		&lt;li&gt;There is a preference to not compile httpd modules from source&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;One advantage with this method is that if proxying with plain http (not https), tools like &lt;a class="wikilink" href="http://swik.net/snort"&gt;snort&lt;/a&gt; or &lt;a class="wikilink" href="http://swik.net/tcpdump"&gt;tcpdump&lt;/a&gt; can view the conversation back and forth. This can be useful for troubleshooting issues.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Bottom line:&lt;/strong&gt; useful only in limited circumstances, and not a good choice for high-volume or business-critical installations.&lt;/p&gt;


	&lt;h2&gt;Tomcat mod_jk (Apache 1.3 and greater)&lt;/h2&gt;


	&lt;p&gt;The Tomcat mod_jk httpd module has gone through a long cycle of development and improvements. It&amp;#8217;s been around for quite some time and is reasonably stable. This module talks to Tomcat using the &lt;a class="wikilink" href="http://swik.net/AJP13"&gt;&lt;span class="caps"&gt;AJP13&lt;/span&gt;&lt;/a&gt; protocol, which is a packet-oriented binary protocol. Using &lt;span class="caps"&gt;AJP13&lt;/span&gt; has pretty significant performance advantages in that it supports connection persistence, and it implements a form of payload compression to reduce the amount of data traversing the connection. It also has built-in support for handling multiple back-end servers.&lt;/p&gt;


	&lt;p&gt;Although mod_jk is generally stable and performant, it may or may not be the best option. To properly implement mod_jk generally requires doing some code compilation, and configuration factors must match up on both the httpd and Tomcat side. With those caveats, mastery of the vagaries of mod_jk configuration will enable a robust and performant multi-server installation.&lt;/p&gt;


	&lt;p&gt;mod_jk is the best solution for Apache/Tomcat integration if:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Higher performance than mod_proxy is needed&lt;/li&gt;
		&lt;li&gt;Support for multiple back-ends with failover and/or session stickyness is needed&lt;/li&gt;
		&lt;li&gt;Extra effort of compiling httpd modules is not a factor&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;&lt;strong&gt;Bottom line:&lt;/strong&gt; most shops choose this option, as it&amp;#8217;s a heavily used and tested solution that provides redundancy features.&lt;/p&gt;


	&lt;h2&gt;http mod_proxy/mod_proxy_ajp/mod_proxy_balancer (httpd 2.2.x and later)&lt;/h2&gt;


	&lt;p&gt;As of Apache httpd 2.2.x there is native support for the &lt;span class="caps"&gt;AJP13&lt;/span&gt; protocol available without having to compile mod_jk.  The addition of mod_proxy_ajp and mod_proxy_balancer to the httpd codebase reduces the number of hoops to jump through to get &lt;span class="caps"&gt;AJP&lt;/span&gt; connectivity to Tomcat.&lt;/p&gt;


	&lt;p&gt;As with mod_jk, combining mod_proxy_ajp/_balancer allows for complex configurations with multiple back-ends, session stickyness and automatic failover (though failover/failback may still be slightly iffy).  There is still a need to make specific configuration changes on the Tomcat side, but they are essentially the same as you would make for mod_jk integration.&lt;/p&gt;


	&lt;p&gt;mod_proxy_ajp/_balancer is the best choice if:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Using Apache 2.2.x is not an issue&lt;/li&gt;
		&lt;li&gt;Compiling mod_jk is an issue&lt;/li&gt;
		&lt;li&gt;A &amp;#8216;pure&amp;#8217; Apache httpd installation is needed&lt;/li&gt;
		&lt;li&gt;Being slightly on the &amp;#8216;bleeding edge&amp;#8217; is acceptable (mod_proxy_ajp is not as mature as mod_jk)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;&lt;strong&gt;Bottom line:&lt;/strong&gt; mod_proxy_ajp is a clean implementation that comes with Apache 2.2.x, but since it is relatively newer, it may require more testing than the other choices. With time, this native implementation of &lt;span class="caps"&gt;AJP13&lt;/span&gt; should become the favored one, with mod_jk becoming vestigial.&lt;/p&gt;
</doap:description>
        <description>Apache Tomcat is capable of serving as a HTTP/HTTPS server, but Apache httpd can be used as the front end for client requests as well. Listed are popular options for establishing this integration.


	Options for connecting Apache to Tomcat&amp;#8217;s Servlet/JSP engine


	
	mod_proxy
		mod_jk
		mod_proxy_ajp
	


	Each of these choices has its advantages and disadvantages.


	httpd mod_proxy and ProxyPass/ProxyReverse


	httpd mod_proxy and ProxyPass/ProxyReverse is a quick and easy way to connect h</description> 
	  <!-- see doap:description for full description -->
        <link>http://swik.net/Tomcat-httpd-integration</link>
                <category>tomcat</category>
        <category>Apache</category>
        <category>integration</category>

        <pubDate>Thu, 22 Feb 2007 10:58:04 -0800</pubDate>
        <lastBuildDate>Mon, 26 Feb 2007 15:10:42 -0800</lastBuildDate>
                </channel>
</rss>
