Wednesday, May 13, 2009

How to install GlassFish on CentOS and other Redhat derivatives

First you need to have Java installed, I prefer OpenJDK, which is available from EPEL , a community-run project which makes Fedora packages available to users of Red Hat Enterprise Linux 5, CentOS 5, and other RHEL 5 derivatives. First install the package that enables the EPEL repository:

su -c "rpm -Uvh"

Then fetch the packages needed:

su -c "yum install java-1.6.0-openjdk"

su -c "yum install java-1.6.0-openjdk-devel"

Set the JAVA_HOME environment variable to point to the location of the JDK installation. To find that location you can do a which java and repeated  ls -l to follow the links to the concrete location.

Do the installation, e.g.:

java -Xmx256m -jar glassfish-installer-v2.1-b60e-linux.jar

Add the as-install/bin/ directory to the PATH environment variable.

To connect to the admin console, open a web browser to on http://hostname:4848

For login, the default admin user name is admin and the password is adminadmin


No comments: