CentOS installation JDK and installation GlassFish

Source: Internet
Author: User
Tags administrator password glassfish

1. Download the JDK for the CentOS version first: Download: jdk-7u75-linux-x64.tar.gz

2. Download the JDK locally and upload to the opt temp directory of the CentOS system

3. Before installing your own downloaded JDK, take a look at the JDK version of the newly installed CentOS system, if it is best to uninstall it and then install your own downloaded JDK version, in the terminal input

Java-version//See if the system has its own javajdk, my server does not have a JDK

4. Create a new JDK installation directory, I am here to create a new Java directory under/usr/, command: Mkdir/usr/java, and then jdk-7u75-linux-x64.tar.gz The compressed package is copied from the OPT directory to the/usr/java directory with the following command:

    1. CP Jdk-7u75-linux-x64.tar.gz/usr/java

5. Unzip the: jdk-7u75-linux-x64.tar.gz package that you just downloaded, the command is as follows:

    1. Tar xvf jdk-7u75-linux-x64.tar.gz

6. When the decompression is complete, go to:

    1. [[Email protected]~]# cd/etc
    2. [Email protected] etc]# VI profile

7. Add the following command at the end of the profile file:

    1. Export java_home=/usr/java/jdk1.7.0_75
    2. Export JRE_HOME=/USR/JAVA/JDK1.7.0_75/JRE
    3. Export path= $PATH:/usr/java/jdk1.7.0_75/bin
    4. Export Classpath=./:/usr/java/jdk1.7.0_75/lib:/usr/local/java/jdk1.7.0_75/jre/lib

8. Enter: Wq save and exit before restarting the CentOS system

9. After restarting the system, enter: Java-version, if you see the following instructions your JDK has been installed successfully.

10. Download and install GlassFish:

: Https://glassfish.java.net/download.html#gfoseTab

(1) Create a new folder

Cd/usr

mkdir GlassFish

CD GlassFish

(2) Unzip the zip file:

Unzip-q Glassfish-4.0-ml.zip

(3) Create user groups, authorize:

[Email protected] share]# Groupadd webserver
[Email protected] share]# useradd-m-G webserver-g webserver WebApp
[[email protected] share]# ID WebApp
[Email protected] share]# passwd WebApp

[Email protected] share]# chown-r webapp:webserver/usr/glassfish

(4) Set the running GlassFish as the service:

#!/bin/bash
# description:glassfish Start Stop Restart
# Processname:glassfish
# chkconfig:234 20 80
Java_home=/usr/java/jdk1.7.0_75
Export Java_home
Path= $JAVA _home/bin: $PATH
Export PATH
Glassfish_home=/usr/glassfish/glassfish4

Case $ in
Start
SH $GLASSFISH _home/bin/asadmin Start-domain domain1
;;
Stop
SH $GLASSFISH _home/bin/asadmin Stop-domain domain1
;;
Restart
SH $GLASSFISH _home/bin/asadmin Stop-domain domain1
SH $GLASSFISH _home/bin/asadmin Start-domain domain1
;;
Esac
Exit 0

(5) Authorization, and set boot GlassFish:

[Email protected] init.d]# chmod 755 GlassFish
[Email protected] init.d]# chkconfig--add GlassFish
[Email protected] init.d]# chkconfig--level 234 glassfish on

(6) Start GlassFish

[[Email protected] init.d]# service GlassFish start

(7) Modify the admin admin account password:

Cd/usr/glassfish/glassfish4/bin

./asadmin Change-admin-password

User name: admin

Old password: null value

New Password: **********

(8) Set Remote access: Enable GlassFish Security management allows remote access to Das

[Email protected]:/opt/glassfish3/bin#./asadmin Enable-secure-admin
Remote failure: At least one administrator user's password is empty, and security management does not allow the password to be empty. Use the Change-admin-password command or the administration console to create a non-empty password for the administrator account.
Command Enable-secure-admin failed.
[Email protected]:/opt/glassfish3/bin#./asadmin Change-admin-password
Enter the administrator user name [default: Admin]>
Please enter the Administrator password > [default admin password is blank]
Please enter a new Administrator password >
Please enter the new Administrator password again >
Authentication failed for user admin (typically, this means that the user name and/or password are invalid)
Command Change-admin-password failed.
[Email protected]:/opt/glassfish3/bin#./asadmin Change-admin-password
Enter the administrator user name [default: Admin]>
Please enter the Administrator password >
Please enter a new Administrator password >
Please enter the new Administrator password again >
Command Change-admin-password has been executed successfully.
[Email protected]:/opt/glassfish3/bin#./asadmin enable-secure-admin
Enter admin username > Admin
Enter admin password for user "admin" >
For the changes in security management to take effect, you must restart all running servers.
Command Enable-secure-admin has been executed successfully.
[Email protected]:/opt/glassfish3/bin# service GlassFish Restart

(9) Restart GlassFish:

[[Email protected] ~] #service glassfish Restart

11. After Telnet glassfish:

The war file is in the Dist file directory under the locally deployed project folder;

Each time you modify in NetBeans, you can regenerate the war file by cleaning up and building it;

CentOS installation JDK and installation GlassFish

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.