Notes on installing GlassFish4.0 on CentOS 6.5

Source: Internet
Author: User

Notes on installing GlassFish4.0 on CentOS 6.5

Notes on installing GlassFish4.0 on CentOS 6.5

1. Install JDK. Pay attention to the number of digits in the operating system, 64 or 32:

[Root @ bkjia ~] # Mkdir/usr/java
[Root @ bkjia ~] # Cd/usr/java
[Root @ bkjia java] # rpm-Uvh/bak/jdk-7u55-linux-x64.rpm
 
[Root @ bkjia java] # JAVA_HOME =/usr/java/jdk1.7.0 _ 55
[Root @ bkjia java] # export JAVA_HOME
[Root @ bkjia java] # PATH = $ JAVA_HOME/bin: $ PATH
[Root @ bkjia java] # export PATH
 
[Root @ bkjia java] # vi/etc/profile
JAVA_HOME =/usr/java/jdk1.7.0 _ 55
Export JAVA_HOME
PATH = $ JAVA_HOME/bin: $ PATH
Export PATH
[Root @ bkjia java] # source/etc/profile
 
[Root @ bkjia ~] # Echo $ JAVA_HOME
/Usr/java/jdk1.7.0 _ 55

2. Download and install glassfish 4, ml multi-language edition

[Root @ bkjia ~] # Mv glassfish-4.0-ml.zip/usr/share/glassfish-4.0-ml.zip.
[Root @ bkjia ~] # Cd/usr/share
[Root @ bkjia share] # unzip-q glassfish-4.0-ml.zip
 
[Root @ bkjia share] # groupadd webserver
[Root @ bkjia share] # useradd-m-g webserver-G webserver webapp
[Root @ bkjia share] # id webapp
[Root @ bkjia share] # passwd webapp
[Root @ bkjia share] # chown-R webapp: webserve/user/share/glassfish4

3. Set running glassfish as a service

[Root @ bkjia ~] # Cd/etc/init. d
[Root @ bkjia init. d] # vi glassfish
#! /Bin/bash
# Description: Glassfish Start Stop Restart
# Processname: glassfish
# Chkconfig: 234 20 80
JAVA_HOME =/usr/java/jdk1.7.0 _ 55
Export JAVA_HOME
PATH = $ JAVA_HOME/bin: $ PATH
Export PATH
GLASSFISH_HOME =/usr/share/glassfish4/glassfish
 
Case $1 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
 
 
[Root @ bkjia init. d] # chmod 755 glassfish
[Root @ bkjia init. d] # chkconfig -- add glassfish
[Root @ bkjia init. d] # chkconfig -- level 234 glassfish on

4. Start glassfish

[Root @ bkjia init. d] # service glassfish start
Waiting for domain1 to start .........
Successfully started the domain: domain1
Domain Location:/usr/share/glassfish4/glassfish/domains/domain1
Log File:/usr/share/glassfish4/glassfish/domains/domain1/logs/server. log
Admin Port: 4848
Command start-domain executed successfully.

5. Modify the admin account password.

[Root @ bkjia init. d] # cd/usr/share/glassfish4/glassfish/bin
[Root @ bkjia bin] #./asadmin change-admin-password

6. Set Remote Access

[Root @ bkjia bin] #./asadmin -- host 192.168.1.114 -- port 4848 enable-secure-admin

7. Restart glassfish
 
[Root @ bkjia ~] # Service glassfish restart

8. If no access is available, Enable Firewall ports 4848 and 80.

[Root @ bkjia ~] # Vi/etc/sysconfig/iptables
-A input-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 4848-j ACCEPT
[Root @ bkjia ~] #/Etc/init. d/iptables restart

9. Disable the glassfish Service

[Root @ bkjia ~] # Service glassfish stop
Waiting for the domain to stop ....
Command stop-domain executed successfully.

Install GlassFish3.1.2 on Ubuntu 12.04

Install GlassFish4.0 on CentOS to configure JDBC connection to MySQL

For more information about GlassFish, click here.
GlassFish: click here

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.