Single Tomcat 7 Webapp with Apache2 with Ajp Connector

As I had to some pages to get this information together, here’s to to set up a single tomcat webapp as the root of an apache server (on Debian, but should work similarly on other systems).
Assuming you’re configuring the server for the domain

Setup your tomcat whereever you like. Per default, it already has the necessary AJP connector configured on port 8009.

In order for your webapp to be the root webapp, delete the existing ROOT directory, and rename your war file to ROOT.war and put it in the webapps directory, then start Tomcat. That’s it for Tomcat.

For the Apache configuration (being root), go to /etc/apache2/sites-available, create a file named (yes, .com not .conf. But might work too) and put the following in it

<VirtualHost *:80>
    ServerAlias *
    ProxyPreserveHost on
    ProxyRequests     off
    ProxyPass / ajp://localhost:8009/
    ProxyPassReverse / ajp://localhost:8009/

and run

a2enmod proxy_ajp
service apache2 restart

After this, you webapp should be available at

This entry was posted in Software. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please solve this little equation for verifying that you\'re human *