Tag Archives: webapp

glassfish and apache

Running a web server in front of a java application server makes sense in almost all production scenarios, where end users from the internet connect directly to your site. The web server offers you much more configuration, security and performance features than the integrated http connector of any java application server. Software developers sometimes argue, that it should work (and of course it does). But if you want to speed up your website and tune your weblayer with optimizing settings like cache-control headers, turn of Etags and so on, a java application server doesn’t allow you to modify this settings.

Therefore, web servers like apache httpd are running in front of the application server and you can configure almost everything you want with apache httpd and apache modules. The connections from apache to the java application server (cluster) are configured through additional apache modules. Commercial Vendors like BEA offers you apache modules for Weblogic to connect. For Tomcat we saw a lot of different modules over the last years. These were mod_jk, mod_webapp, mod_jk2 and the return of mod_jk. With apache 2.2, there’s a build in module, called mod_proxy_ajp. The connection from apache to tomcat with the mod_jk or the mod_proxy_ajp is done by the AJP protocol, which is a binary protocol and faster than http. Before apache 2.2 and its mod_proxy_ajp module, some people used mod_proxy as a revers proxy from apache to tomcat. This might be good for small web sites, and if you do not need to pass some additional informations to you app server.

Now to glassfish. Currently, glassfish V1 and V2 ships only with a http connector module. There’s no apache httpd mod_glassfish or something like that. You can connect with httpd’s mod_proxy_reverse.

But regarding some blog entries from Jean-Francois Arcand and Amy Roh, it’s possible to extend glassfish with the libs ( tomcat-ajp.jar modeler-1.1.jar commons-logging-1.0.4.jar) from tomcat and tweak some config files.
But stop. Are there different versions of these jars? Which jar version fits to which glassfish version?

Some people already blogged about their problems to extend glassfish withe the ajp protocol.

Why does the glassfish distribution currently do not bundle the ajp libs and missing configurations in the config files?

In my opinion, it is very very important for the future success of glassfish, to offer build in connectors to apache (with ajp), to Sun JES Web Server (an NSAPI Module?) and MS IIS . These connectors should be well documented and easy to configure for admins and developers.