Skip to content

Instantly share code, notes, and snippets.

@AmrAbdeen
Created August 31, 2015 21:30
Show Gist options
  • Save AmrAbdeen/fe5a959647c1c3cab890 to your computer and use it in GitHub Desktop.
Save AmrAbdeen/fe5a959647c1c3cab890 to your computer and use it in GitHub Desktop.
How to install glassfish server v4.1 on linux mint 17.2 source: http://www.lyonlabs.org/howto/howdoi-glassfish.html
#Download the ZIP file from Oracle. Make sure you have a current JDK installed on your machine (Glassfish 4.1 supports Java 8).
As root, enter the directory you want to install to (I install it in /usr/share) and extract the ZIP file there.
#Add the binaries directory of your new installation to the PATH. One way of doing this is to use a profile script in /etc/profile.d. Create a file there whose name ends in .sh, make it executable, and add this line:
export PATH=/usr/share/glassfish4/glassfish/bin:$PATH
Log out and back in to make the change take effect.
#Create a group and a user for GlassFish.
for Debian-based systems:
addgroup --system glassfish
adduser --system --shell /bin/bash --ingroup glassfish glassfish
#Add the following lines to /etc/security/limits.conf to increase the maximum number of open files for the user that Glassfish will run as:
glassfish soft nofile 32768
glassfish hard nofile 65536
#You will also need to add this line in /etc/pam.d/su:
session required pam_limits.so
#As root, in /usr/share, change the permissions of the newly-created GlassFish directory:
chown -R glassfish:glassfish glassfish4
#If you want to use your own domain name instead of the default domain1, become the glassfish user (as root, su - glassfish), then delete the default domain and create a new one:
asadmin delete-domain domain1
asadmin create-domain --savemasterpassword <domain-name>
#You will be prompted for new admin and master passwords. If you will be installing on several machines, I suggest that you give your domain the same name as the hostname of the machine you are installing on; that way, you can use the same startup scripts on all machines, using $HOSTNAME for the domain.
Start the domain:
asadmin start-domain <domain-name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment