I spent quite a while learning how to configure Apache 2.2.4 to do what I needed (must be a slow learner). Most of my confusion centered around mod_proxy, mod_proxy_ajp and expressions that mod_rewrite required to send requests for specific pages to Tomcat listening on an internal connection. I found lots of advice on various forums but much of it was regurgitated from a one or two posts that had the right idea but were not totally correct. That had me stuck for quite a while until I figured out what was wrong.
Here is what worked for me. This is the file httpd-vhosts.conf which specifies how apache should deal with requests in a name based virtual host. I needed to pass requests that have a certain file extension to Tomcat but allow apache to deliver images and static pages. In my case these were *.dxp pages. It would work as well for *.jsp pages by simply changing the file extension dxp to jsp in the rewrite rule.
NameVirtualHost *:80
<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com
ServerAdmin web@domain.com
DocumentRoot "/home/domain/htdocs"
DirectoryIndex index.html index.dxp
ErrorLog /home/domain/logs/error_log
CustomLog /home/domain/logs/access_log common
ErrorDocument 401 /notauthorized.html
ErrorDocument 403 /forbidden.html
ErrorDocument 404 /notfound.html
ErrorDocument 500 /internalerr.html
ErrorDocument 503 /unavailable.html
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
# send dxp requests to tomcat
RewriteEngine On
RewriteRule ^(.+)\.dxp$ ajp://localhost:8009/$1.dxp [P]
<Directory "/home/domain/htdocs">
Options
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
<Location /WEB-INF/ >
deny from all
</Location>
</VirtualHost>
Note that my Rewrite Rule uses ^(.+) rather than /(.*) which is what I found on many of the forum posts. When I used /(.*) Apache sent all request to Tomcat not just the ones I was looking for.
I was happy to see mod_proxy_ajp as an option for connecting to Tomcat. It's much simpler to configure than mod_jk which is required for Apache 2.0.x. I was worried that it might be slower but tests with Apache Bench allayed my fears.
You have to configure Tomcat to respond to the ajp requests. Here's a sample of my server.xml file for Tomcat.