1.glassfish4.0:https://glassfish.java.net/download.html#gfosetab
2. Transfer the downloaded Glassfish-4.0.zip to the server/home/[usrname]/opt directory, using the command transfer:
SCP glassfish-4.0.zip [email protected] [usrname][1-5]:/home/[usrname]/opt
3. Create folder:/HOME/[USRNAME]/OPT/GLASSFISH4, using the command:
sudo mkdir glassfish4/home/[usrname]/opt/
4. Unzip the. zip file into the/home/[usrname]/opt/glassfish4 folder and use the command:
Unzip Glassfish-4.0.zip/home/[usrname]/opt/glassfish4
5. Add GlassFish Users:
sudo useradd--system glassfish-d/home/[usrname]/opt/glassfish4
6. Set Directory Permissions:
sudo chgrp-r [usrname]/home/[usrname]/opt/glassfish4/
sudo chown-r glassfish/home/[usrname]/opt/glassfish4/
7. Set Script Execution permissions:
sudo chmod-r +x/home/[usrname]/opt/glassfish4/bin
sudo chmod-r +x/home/[usrname]/opt/glassfish4/glassfish/bin
8. Start the service under the GlassFish user
sudo su glassfish
Cd/home/[usrname]/opt/glassfish4/bin
./asadmin Start-domain Domain1
9. Modify the password of the default user admin
Locate the Asadmin file in the bin directory, and then click Start to execute:
./asadmin
Asadmin>change-admin-password
Prompt for user name: press ENTER directly (do not enter, otherwise you will get an error)
Prompt password: press ENTER directly
Enter new password: [usrname]glassfish
Confirm Password: [usrname]glassfish
Prompt for modification success after carriage return
10. Turn on remote access permissions and exit GlassFish users
Asadmin >enable-secure-admin
Asadmin >exit
11. Turn off the service and restart the service
./asadmin Stop-domain
./asadmin Start-domain Domain1
12. Add command self-start
sudo vi/etc/rc.local
/home/[usrname]/opt/glassfish4/bin/asadmin Start-domain domain1
13. Reboot the system and check the installation results:
http://[Machine ip]:4848/
GlassFish Application Server Installation configuration