Quote:
Originally Posted by bathory
but WP apart from php uses css, js and other stuff that it could be difficult, if not impossible, to use them with tomcat.
|
That is nonsense.
Whilst Tomcat is primarily used to run Java servlets, it still includes a perfectly functional HTTP server (Coyote) which can and does
serve any static file format you want out of the box without any extra configuration needed for common formats. There is nothing remotely difficult about serving CSS and JS with Tomcat.
(And even if this was somehow not possible, it would still be
very easy to serve such files by proxying them through a servlet which generated the appropriate HTTP response.)
Quote:
AFAIK tomcat can parse simple php pages
|
Tomcat does
not parse PHP pages. Like Apache HTTPd and other servers, it simply forwards the requests onto a PHP engine, which is what does the parsing.
In the linked example, the PHP engine is the Quercus servlet - an implementation of PHP on the JVM - which can be used with Tomcat, but is part of Caucho Resin (a different and proprietary server).
Things have possibly changed since I tried getting Quercus running, but many years back I found it not worth the effort.
Quercus is only one option of how to run PHP software via Tomcat server. Another is to use a servlet which implements the
FastCGI protocol to connect to
PHP-FPM. A quick search reveals
jFastCGI does this, but I've never used it so no idea how well it works.
(I prefer Jetty to Tomcat, and Jetty has a
built-in FastCGI servlet, which I've successfully used to run both PHP and Python software.)
However, an important thing to keep in mind is that a lot of PHP software expects Apache HTTPd and come with .htaccess files containing rewrite rules and other directives, which then need to be translated to have the software run correctly. (From memory, running Wordpress on Jetty wasn't a big deal, but some of the other CMSes I was testing were very fiddly.)
Anyhow, pairing Apache HTTPd and Tomcat is a common and well-documented process, so unless there's a specific reason to not simply setup a reverse proxy, that should probably be where the effort is focused.