Home > Support > HOWTO List > JSP Hosting: Glassfish

Glassfish Application Server

GlassFish is an open source application server which implements the Java EE platform. This includes the latest versions of technologies such as such as JavaServer Pages(JSP), JavaServer Faces(JSF), Servlet, Enterprise JavaBeans, Java API for Web Services(JAX-WS), Java Architecture for XML Binding(JAXB), Web Services Metadata for the Java Platform, 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.

The script can install either version 3 or 4 of Glassfish. Glassfish 4.0 is the latest stable version but still pretty new, and requires JDK 7 or greater. Version 3 can use either JDK 6 or 7 so by default the script w/ install JDK 7 if java is not present. If you have other apps still running JDK 6, this would be a good reason to stick the 3.x branch of Glassfish. (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 enables the ajp connector provided with Glassfish by running the command:

./bin/asadmin create-network-listener  --listenerport 8009 --address --protocol http-listener-1 --jkenabled true jk-connector

You can follow the steps here to put Apache in front of Glassfish requests (e.g. so you can access Glassfish apps without using port 8080 in the URL):


To use mod_proxy_ajp to connect Apache to Glassfish.

Connecting to the Glassfish admin interface

Similar to how it is described on our Jboss howto, you can connect to the Glassfish admin interface using a SSH tunnel.

For instance run this command from your Linux workstation:

ssh -l root -L 4849:localhost:4848

Then point your browser to: