Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a website using PhP and Apache Webserver (e.g. mod_php). I need to use Tomcat for another purpose. Rather than just add Tomcat to the current mix, I'm wondering if I should eliminate Apache Webserver and simply use Tomcat to serve static webpages assuming I can get PhP onto Tomcat somehow.

My PhP usage on the website is very very small.

Can PhP be installed into Tomcat such that Apache Webserver can be removed? If so, if this a good practical solution? Or, will performance across the board suffer in Tomcat by doing so? Am I splitting hairs by worrying about trying to simplify the number of software pieces installed, or would it be worth it to do so? Looking for some conventional wisdom.

If PhP is added to Tomcat, would I need to reach into the PhP code and modify anything there to get things working now that Apache Webserver is out of the picture, or would it be plug-and-play (no modification required)?

share|improve this question
up vote 4 down vote accepted

You can, but only with PHP 4.

Also, it is generally a good idea to have an Apache server in front of a Tomcat server, and there are several reasons for that, see more on this link:

share|improve this answer
OK, great fbh, sounds like the mainstream thing to do is use Apache webserver in conjunction with Tomcat. I don't want to go off on any weird tangents. Thanks – gkdsp Jan 27 '12 at 22:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.