Ubuntu12.04 install GlassFish3.1.2

Source: Internet
Author: User
Due to the consistency requirements of the company's products, we switched from Jetty to GlassFish3.1.2. this time we installed GlassFishwebprofile on Ubuntu12.04Server (64bit). This article mainly comes from idea

Due to the consistency requirements of the company's products, we switched from Jetty to GlassFish3.1.2. this time we installed GlassFish web profile on Ubuntu 12.04 Server (64bit.

The content of this paper mainly comes from http://www.nabisoft.com/tutorials/glassfish/installing-glassfish-311-on-ubuntu

The preceding section is very comprehensive. I deleted the section iptables that is not required because we use nginx for forwarding. It also solves some other problems.

For example, GlassFish3.1.2 has changed the security rules. Some additional steps are required.

1. Install JDK and set environment variables.

I installed jdk1.6.

  1. Root @ www.linuxidc.com :~ # Java-version
  2. Java version "1.6.0 _ 32"
  3. Java (TM) SE Runtime Environment (build 1.6.0 _ 32-b05)
  4. Java HotSpot (TM) 64-Bit Server VM (build route 7-b02, mixed mode)
2. Create a dedicated account

Create a glassfish SYSTEM account first

  1. # Adduser -- home/glassfish -- system -- shell/bin/bash glassfish
  2. Adding system user 'glassfish '(UID 108 )...
  3. Adding new user 'glasshai' (UID 108) with group 'nogroup '...
  4. Creating home directory '/home/glassfish '...
Create a user group glassfishadmin
  1. # Groupadd glassfishadm

Add glassfish to the glassfishadm group, and set the directory of the glassfishadmin group to/home/glassfish.

  1. # Usermod-a-G glassfishadm glassfish

 
  1. Chgrp-R glassfishadm/home/glassfish

3. Install unzip
  1. Apt-get install unzip

4. Download glassfish

Switch to the glassfish user and download and decompress

  1. Su glassfish
  2. Cd/home/glassfish
  3. Mkdir downloads
  4. Cd downloads
  5. Wget http://download.java.net/glassfish/3.1.2/release/glassfish-3.1.2-web.zip
  6. Unzip glassfish-3.1.2.zip
Copy the extracted file to the/hom/glassfish directory, and then exit the user.
  1. Mv/home/glassfish/downloads/glassfish3/*/home/glassfish/
  2. Mv/home/glassfish/downloads/glassfish3/. org. opensolaris, pkg/home/glassfish/. org. opensolaris, pkg
 
  1. Exit
5. modify directory permissions

Make sure that the program runs under the glassfish user

  1. Root @ www.linuxidc.com :~ # Chown-R glassfish/home/glassfish
  2. Root @ www.linuxidc.com :~ # Chmod-R ug + rwx/home/glassfish/bin/
  3. Root @ www.linuxidc.com :~ # Chmod-R ug + rwx/home/glassfish/bin/
  4. Root @ www.linuxidc.com :~ # Chmod-R o-rwx/home/glassfish/bin/
  5. Root @ www.linuxidc.com :~ # Chmod-R o-rwx/home/glassfish/bin/
6. Modify the port

Modify/hom/glassfish/domains/domain1/config/domain. xml as follows:

  1. <Network-listeners>
  2. <Network-listener Port="8081" Protocol=Http-listener-1" Transport="Tcp" Name=Http-listener-1" Thread-pool="Http-thread-pool"> Network-listener>
  3. <Network-listener Port="8181" Protocol=Http-listener-2" Transport="Tcp" Name=Http-listener-2" Thread-pool="Http-thread-pool"> Network-listener>
  4. <Network-listener Port="4848" Protocol="Admin-listener" Transport="Tcp" Name="Admin-listener" Thread-pool="Admin-thread-pool"> Network-listener>
  5. Network-listeners>
In this way, http uses 8081, https uses 8181, and AdminGUI uses port 4848.

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.