Tomcat and Apache side by side

Hi folks,

We have a production server running on Tomcat 5.5.15 (JSP version: 2.0),

There’s a new little script which has been written with PHP. I am planning to run ‘Apache’ side by side ‘Apache-Tomcat’ in order to support PHP and MySQL required by that new script.

I heard about mod_proxy solution which suggest that first you have to install Apache server then Tomcat. I cannot do so as Tomcat already running. Any suggestion how can I run both server side by side and let Apache handle any PHP script operation?

– or –

Is there any better way to let Tomcat handle PHP?

Thanks again.

The proxy solution is your best bet – the switch over can be very fast presuming you can test it first as all you need to do is stop tomcat, deploy the apache proxy config and light up tomcat produciton-wise. This is a very good idea in general as apache is a lot better to have at the edge than tomcat and you can leverage a lot of apache feature to improve security and performance. You don’t need to uninstall tomcat, apache just won’t start when first installed as tomcat is holding port 80.

Another way would be to get two distinct IP addresses and host one site on one and the other on the other IP. This would still require bouncing tomcat as the IP dance will necessistate that.