Installing and configuring Glassfish 4.1 on RHEL and Centos

cd /opt wget http://dlc.sun.com.edgesuite.net/glassfish/4.1/release/glassfish-4.1.zip unzip glassfish-4.1.zip mv glassfish4 glassfish create glassfish user groupadd glassfish useradd -s /bin/bash -g glassfish glassfish chown -R glassfish: /opt/glassfish change the user password passwd glassfish nano /etc/init.d/glassfish add the below line #!/usr/bin/env bash # description: Glassfish start/stop/restart # processname: glassfish # chkconfig: 2445 20 80 JAVA_HOME=/usr/java/jdk1.7.0_75 export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH GLASSFISH_HOME=/opt/glassfish