Install and deploy Glassfish in CentOS 7

Source: Internet
Author: User
Tags glassfish

Install and deploy Glassfish in CentOS 7

GlassFish is a robust business-compatible application server that delivers product-level quality and is free for development, deployment, and redistribution.

Environment: CentOS7.2

Steps:

1. Deploy the JDK Environment

Bytes

# Mvjdk1.8.0 _ 91 // usr/local/jdk

# Vim/etc/profile. d/java. sh

# Cat/etc/profile. d/java. sh

JAVA_HOME =/usr/local/jdk

JAVA_BIN = $ JAVA_HOME/bin

JRE_HOME = $ JAVA_HOME/jre

PATH = $ PATH: $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin

CLASSPATH = $ JAVA_HOME/jre/lib: $ JAVA_HOME/jre/lib/charsets. jar

# Source/etc/profile. d/java. sh

# Java-version

Javaversion "1.8.0 _ 91"

Java (TM) SERuntimeEnvironment (build1.8.0 _ 91-b14)

JavaHotSpot (TM) 64-BitServerVM (build25.91-b14, mixedmode)

Ii. Install Glassfish

#Unzipglassfish-4.1.1.zip

# Mvglassfish4 // usr/local/glassfish

# Cd/usr/local/glassfish/bin

Start Glassfish (ensure that the hostname and ip corresponding records are added to/etc/hosts)

#./Startserv &

# Netstat-anput | grepjava

Tcp600: 8686: * LISTEN12826/java

Tcp600: 4848: * LISTEN12826/java

Tcp600: 8080: * LISTEN12826/java

Tcp600: 3700: * LISTEN12826/java

Tcp600: 8181: * LISTEN12826/java

Tcp600: 7676: * LISTEN12826/java

Open firewall port

# Firewall-cmd -- zone = public -- add-port = 8686/tcp -- permanent

# Firewall-cmd -- zone = public -- add-port = 4848/tcp -- permanent

# Firewall-cmd -- zone = public -- add-port = 8080/tcp -- permanent

# Firewall-cmd -- zone = public -- add-port = 3700/tcp -- permanent

# Firewall-cmd -- zone = public -- add-port = 8181/tcp -- permanent

# Firewall-cmd -- zone = public -- add-port = 7676/tcp -- permanent

# Firewall-cmd -- reload

Set the Administrator account and password

# Cd/usr/local/glassfish/bin/

#./Asadminchange-admin-password

Enteradminusername [default: admin]>

Entertheadminpassword>

Enterthenewadminpassword>

Enterthenewadminpasswordagain>

Commandchange-admin-passwordexecutedsuccessfully.

Enable remote access

#./Asadminenable-secure-admin

Enteradminusername> admin

Enteradminpasswordforuser "admin">

Youmustrestartallrunningserversforthechangeinsecureadmintotakeeffect.

Commandenable-secure-adminexecutedsuccessfully.

Restart service

#./Stopserv

Commandstop-domainexecutedsuccessfully.

#./Startserv

After restarting the service, you can use the account created above to remotely connect to the console

Https: // hostname: 4848 or serverip: 4848

Deploy a simple application

After the deployment is successful, you can log on to http: // hostname: 8080/hello for access.

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.