Originally published on 2017-11-27

Update: 2020-08-23 Just use Docker and don’t bother with polluting your host system. Link to heading

I’ll skip instructions on building and installing the actual Tomcat server, there’s plenty of tutorials available on the web.

My issue was setting up the proxying on specific alias to pass Apache Web Server requests to TomCat and back.

I wanted the TomCat to be visible on javahost.kokaruk.com from the outside.
Local connections are still open on any alias on port 8080.

Solution was easier than I thought.
Apart from enabling AJP protocol in main Apache config, all I had to do is to modify virtual host settings for javahost.kokaruk.com

Add two lines of config:

ProxyPass "/" "ajp://javahost.kokaruk.com:8009/"
ProxyPassReverse "/" "ajp://javahost.kokaruk.com:8009/"

Last step is to start tomcat services in terminal

/Library/Tomcat/bin/startup.sh

Tomcat screenshot

PS. Terminal command to stop TomCat

/Library/Tomcat/bin/shutdown.sh