Solution 1:

I strongly suspect your problem is related to AJP.

I was in a course with one of the main Tomcat developers a few weeks ago (he was running it), his advice was to avoid AJP and mod-JK etc, and stick to regular mod-proxy HTTP.

Reasons:

  1. It's by far the most mature and stable Tomcat connector.
  2. Neither AJP implementation has been consistently developed; both projects have suffered a bit of stop / start.
  3. NBIO does not result in any real world performance gain over blocking-IO, in this situation.

My advice, try using regular mod-proxy HTTP with your current setup. It's the least change for you and it will take you on to the most widely used and stable Tomcat deployment architecture.

/ Richy

Solution 2:

My current preferred stack is to use nginx as a replacement for Apache. Wherever necessary, php-fpm fills in the need for PHP. Such a setup has worked nicely for deploying apps such as Rails, Magento and SugarCRM.

Solution 3:

Glassfish will be more scalable than Tomcat because it uses Grizzly (NIO based). You don't have many options other than a variation of Tomcat, Jetty, or Glassfish because of the Java requirement. PHP can be run using Quercus, but it may be better to just deploy it using Nginx.

Solution 4:

There are PHP implementations on Java, The one I know (but haven't used) is this one. There is a blog post on how to install it on GlassFish (including WordPress), but I guess the installation on tomcat is the same. Regarding the .htaccess, you haven't written what exactly you have there, but if it is for URL rerwriting then there is the UrlRewriteFilter who does the same work with the same semantics.