views:

88

answers:

2

I am about to migrate a web application from PHP to JAVA (GWT) but I would like to do it iteratively, chunk by chunk. Currently I use apache to serve the HTML and PHP files, but in the conversion period I also need Jetty or Tomcat to handle the servlets. And also from port 80 I guess? How can I do such a mix?

+1  A: 

Start by switching from Apache-only to Tomcat-only.

Tomcat can serve the static files and can run PHP through a separate pipe. This way everything is on a single port and served in the same application space.

Then you can convert the parts, pages, etc. piecemeal into Java.

Jason Cohen
Can't argue with that advice, also be aware that Java requires a lot more memory than PHP, so if you're not running your own server you might run into problems. Typical Java programs need about 4x the memory that the equivalent PHP program would. I made the 4x figure up, but it seems about right
rustyshelf
Great point, thanks for tacking it on!
Jason Cohen
A: 

Another option is to use mod_proxy, you send the requests destined for your servlet container using mod_proxy. In this case the apache host is acting as a reverse proxy to the servlet container while serving static content and PHP.

(This is basically reverse of what Jason Cohen suggested).

Choose whatever works best for you.

Redbeard 0x0A