reverse proxying from apache to tomcat

After much hemming and hawing, I was able to get Apache working as a reverse proxy to Tomcat today.

<VirtualHost *:80>
    ServerName domain.com
    ServerAlias www.domain.com
    ProxyPreserveHost on
    ProxyPass / http://localhost:8080/path/
    ProxyPassReverse / http://domain.com:8080/path/
</VirtualHost>

That’s all you need (though you can add much more). Note the trailing slashes on the proxy paths – without them, you have no dice.