2010-09-13

FastCGI with Java Servlet containers/servers.

As the exciting debut of REAL Studio Web Edition arrives, the question of deployment arises.

You have two approaches:
  • Quick and simple: Compile with an embedded HTTP Server.
  • Integrate with another web server: Your app is called by the web server via the FastCGI protocol.
The pros and cons: The built-in server is quick and easy to deploy, while fronting with a separate web server allows scalability, sophisticated admin, encryption, and more.





Encryption

If you need encryption to to the end-user, then you must use a separate web server.  The built-in web server is not capable of supporting SSL/TLS encryption. To protect the communication to the end-user, you must use a separate web server with SSL/TLS features.



jFastCGI

For those choosing the separate web server approach, discussion amongst the Web Edition crowd currently revolves around using the Apache HTTP Server ('httpd') as the front-end, calling your Web Edition app. But 'httpd' can be a bear. Some of us would rather use other web servers. For years, I have used Apache Tomcat as a standalone web server as well as for hosting Java Servlets.

Fortunately, there seems to be a good Java Servlet, jFastCGI,  available to enable FastCGI on Servlet-enabled web servers such as Apache Tomcat, Jetty, Oracle Glassfish, JBoss, and others. People seem to be mainly using this to combine a PHP server with their Java server. But it seems possible that RS Web Edition may work just as well, using a couple elements in a simple XML config file.

I've not yet tried jFastCGI. If you have any experience with this servlet or others, please post here. I tried jFastCGI, and got it working. At least the basics are working. Read this other post.

No comments:

Post a Comment