Home > Support > HOWTO List > JSP Hosting: Glassfish

Glassfish Application Server

GlassFish is an open source application server which implements Java EE 5. The Java EE 5 platform includes the latest versions of technologies such as such as JavaServer Pages(JSP) 2.1, JavaServer Faces(JSF) 1.2, Servlet 2.5, Enterprise JavaBeans 3.0, Java API for Web Services(JAX-WS) 2.0, Java Architecture for XML Binding(JAXB) 2.0, Web Services Metadata for the Java Platform 1.0, and many other new technologies.

Using Glassfish


wget http://d.ri.mu/installglassfish.sh
bash installglassfish.sh

This installglassfish script should work on most Redhat-, Ubuntu- and Debian-based distros.

Almost all our distros have a JDK pre-installed.  If not you can install one using our installjava script (Run the script with the '--help' option to get a look at the parameters you can pass to the script).

By default the Glassfish does not run by default on server startup.  However, it is easy enough to do:

You can start/stop/restart the service with: /etc/init.d/glassfish start/stop/restart

You can turn on the service so it runs at bootup: chkconfig --level 3 glassfish on

Debian/Ubuntu users can run update-rc.d glassfish defaults

Connecting Apache to Glassfish

Our glassfish install script does not install neded componends for AJP support.  You will need install the following into glassfish lib directory (usually /usr/local/glassfish/glassfish/lib):

tomcat-ajp.jar
commons-logging.jar
commons-modeler.jar

Then use the following to enable Glassfish AJP:



/usr/local/glassfish/glassfish#-> bin/asadmin

asadmin> create-jvm-options -Dcom.sun.enterprise.web.connector.enableJK=8009

Created 1 option(s)

Command create-jvm-options executed successfully. 

Then just follow the tips here:

http://rimuhosting.com/mod_jk2_and_mod_proxy_ajp.jsp

To use mod_proxy_ajp to connect Apache to Glassfish.