Using Tomcat with Apache httpd

Don't run Tomcat through Apache httpd if you can avoid it

It is advisable to run Tomcat standalone, not connected through Apache httpd, because you will lose at least 50% of Tomcat's response performance by proxying all requests through an Apache httpd module first. For benchmarks and additional details on why you should run Tomcat standalone, see Tomcat: The Definitive Guide, 2nd Edition (O'Reilly).

If you decide that you must run Tomcat behind Apache httpd, we suggest using only the built-in mod_proxy module for proxying the requests to Tomcat. To use mod_proxy, search for the following lines in your Apache httpd's configuration files, and add them if they don’t already exist:

LoadModule proxy_module modules/
LoadModule proxy_http_module modules/
LoadModule proxy_ajp_module modules/

Next, add the following lines anywhere after the LoadModule lines:

ProxyPass        /tcat
ProxyPassReverse /tcat
ProxyVia On 

These lines tell Apache httpd to proxy all requests it receives for

via the HTTP protocol into Tomcat's HTTP connector running on port 8080. Make sure to restart httpd after making the configuration change, and inspect the error log for any problems before proceeding.

In Tomcat's

file, make sure that there is a port 8080
element that is enabled in the configuration. Also, you probably want to set your Connector's
attributes to values that match your Apache httpd web server's host name and port number, so that the responses from Tomcat appear to be coming from Apache httpd. For more information on configuring the
element, see the Connector page in the official Tomcat documentation at


Today's tip was provided by sdozen12 on behalf of MuleSoft. Do you have a question on installing, configuring, or deploying Apache Tomcat? Submit it here.

Want to cash in on your IT savvy? Send your tip to If we post it, we'll send you a $25 Amazon e-gift card.

ITWorld DealPost: The best in tech deals and discounts.
Shop Tech Products at Amazon