사용자 도구

사이트 도구


service:was:weblogic:install

문서의 이전 판입니다!


Install Weblogic

Create Account weblogic on Linux

  • Linux 에서 weblogic 계정을 생성한다.
# useradd -m -g users -s /bin/bash weblogic
# passwd weblogic
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Download Install File

  • Weblogic 을 설치하기 위해서는 bea.com 에서 evaluation version 을 다운로드 받아야 한다. 원래는 해당 사이트에 가입을 하고 다운로드해야 하지만 아래와 같이 직접 다운로드 받을 수 있다. ^^
# su - weblogic
# wget http://download2.bea.com/pub/platform/81/platform816_linux32.bin
or
# wget http://download2.bea.com/pub/platform/81/server816_linux32.bin
or 
# wget http://download2.bea.com/pub/platform/100/server100_linux32.bin
# chmod 755 platform816_linux32.bin

Start Install Weblogic

# ./platform816_linux32.bin -mode=console
Extracting 0%................................................100%
<------------------ BEA Installer - WebLogic Platform 8.1 SP6 ------------------>
Welcome:
--------
This installer will guide you through the installation of WebLogic Platform 8.1 SP6.
Type "Next" or enter to proceed to the next prompt.  
If you want to change data entered previously, type "Previous".  
You may quit the installer at any time by typing "Exit".
Enter [Exit][Next]> 엔터
Select Option:
    1 - Yes, I agree with the terms of the license
    2 - No, I do not agree with the terms of the license
Enter option number to select OR [Down][Exit][Previous]> 1
<------------------ BEA Installer - WebLogic Platform 8.1 SP6 ------------------>
Choose BEA Home Directory:
--------------------------
    "BEA Home" = [/home/weblogic/bea]
Input new BEA Home OR [Exit][Previous][Next]> 엔터 (or 원하는 디렉토리 입력)
<------------------ BEA Installer - WebLogic Platform 8.1 SP6 ------------------>
Choose BEA Home Directory:
--------------------------
    *BEA home choice
 ->1|Yes, Use this BEA home directory [/home/weblogic/bea]
   2|No, return to BEA home directory selection
Enter index number to select OR [Exit][Previous][Next]> 엔터
<------------------ BEA Installer - WebLogic Platform 8.1 SP6 ------------------>
Choose Install Type:
--------------------
 ->1|Complete
    |Install the complete BEA WebLogic Platform.
   2|Custom Installation
    |Choose software components to install and perform optional configuration.
Enter index number to select OR [Exit][Previous][Next]> 엔터
<------------------ BEA Installer - WebLogic Platform 8.1 SP6 ------------------>
Choose Product Directory:
-------------------------
    "Product Installation Directory" = [/home/weblogic/bea/weblogic81]
Input new Product Installation Directory OR [Exit][Previous][Next]> 엔터 (or 원하는 디렉토리 입력)
<------------------ BEA Installer - WebLogic Platform 8.1 SP6 ------------------>
Choose Product Directory:
-------------------------
 ->1|Yes, use this product directory [/home/weblogic/bea/weblogic81]
   2|No, select another product directory
Enter index number to select OR [Exit][Previous][Next]> 엔터
<------------------ BEA Installer - WebLogic Platform 8.1 SP6 ------------------>
Installing files..
0%          25%          50%          75%          100%
[------------|------------|------------|------------]
[**************
<------------------ BEA Installer - WebLogic Platform 8.1 SP6 ------------------>
Installation Complete
Congratulations! 
WebLogic Platform 8.1 SP6 has been successfully installed to /home/weblogic/bea/weblogic81.
Press any key to continue OR [Exit]> 엔터
  • IBM 의 경우에는 /tmp 를 이용하며 500MB 이상이어야 한다.
  • /tmp 용량이 적은 경우 -tmpdir 옵션을 사용한다.
# java -jar ~.jar -mode=console -Djava.io.tmpdir=/bea/tmp

Configure Weblogic Domain

# cd /home/weblogic/bea/weblogic81/common/bin
# ./config.sh -mode=console
<---------------------- BEA WebLogic Configuration Wizard ---------------------->
Create or Extend a Configuration:
---------------------------------
Choose between creating and extending a configuration. Based on your selection,
the Configuration Wizard guides you through the steps to generate a new or extend an existing configuration.
 ->1|Create a new WebLogic configuration
    |    Start here to create a WebLogic configuration in your projects
    |directory.
   2|Extend an existing WebLogic configuration
    |    Start here to extend an existing WebLogic configuration.  Use this
    |option to add applications and services, including Database access (JDBC)
    |and Messaging (JMS). This option also enables you to extend functionality by     
    |enabling WebLogic Workshop.
Enter index number to select OR [Exit][Next]> 엔터
<---------------------- BEA WebLogic Configuration Wizard ---------------------->
Select a Domain Template:
-------------------------
Please select a template from the list or select another directory of templates.
    * [/home/weblogic/bea/weblogic81/common/templates/domains]
   1|Basic WebLogic Platform Domain 8.1.6.0
    |  BEA Systems, Inc.
    |  Create a basic WebLogic Platform domain, without installing sample
    |applications.  Domains created from this template will support the WebLogic
    |Server, WebLogic Workshop, WebLogic Integration and WebLogic Portal runtime
    |functionality, including support for J2EE applications, Web applications,
    |Web Services, custom controls, business processes and portals.  Use domains
    |created from this template for development of WebLogic Platform applications.   
   2|Basic WebLogic Portal Domain 8.1.6.0
    |  BEA Systems, Inc.
    |  Create a basic WebLogic Portal domain, without installing sample
    |applications.   Domains created from this template will support the WebLogic     
    |Server, WebLogic Workshop and WebLogic Portal runtime functionality,
    |including support for J2EE applications, Web applications, Web Services,
    |custom controls and portals.  Use domains created from this template for
    |development of WebLogic Portal applications.
   3|Basic WebLogic Integration Domain 8.1.6.0
    |  BEA Systems, Inc.
    |  Create a basic WebLogic Integration domain, without installing sample
    |applications.   Domains created from this template will support the WebLogic     
    |Server, WebLogic Workshop and WebLogic Integration runtime functionality,
    |including support for J2EE applications, Web applications, Web Services,
    |custom controls and business processes.  Use domains created from this
    |template for development of WebLogic Integration applications.
   4|Basic WebLogic Workshop Domain 8.1.6.0
    |  BEA Systems, Inc.
    |  Create a basic WebLogic Workshop domain, without installing sample
    |applications.   Domains created from this template will support the WebLogic     
    |Server and WebLogic Workshop runtime functionality, including support for
    |J2EE applications, Web applications, Web Services and custom controls.  Use
    |domains created from this template for development of WebLogic Workshop
    |applications.
 ->5|Basic WebLogic Server Domain 8.1.6.0
    |  BEA Systems, Inc.
    |  Create a basic WebLogic Server domain without installing sample
    |applications.
   6|WebLogic Server Examples Domain 8.1.6.0
    |  BEA Systems, Inc.
    |  Create the WebLogic Server Examples domain in a directory outside of the
    |installed kit.  The Examples domain contains a collection of examples to
    |show best practices for coding individual J2EE APIs.
Enter index number to select OR [Down][Exit][Previous][Next]> 엔터
<code>
<code bash>
<---------------------- BEA WebLogic Configuration Wizard ---------------------->
Choose Configuration Option:
----------------------------
    *Do you want to run the wizard in express mode?
 ->1|Yes
   2|No
Enter index number to select OR [Exit][Previous][Next]> 엔터
<---------------------- BEA WebLogic Configuration Wizard ---------------------->
Configure Administrative Username and Password:
-----------------------------------------------
Create a user automatically assigned to the Administrative Role. This user is the default administrator used to start development mode servers.
    |          Name           |              Value              |
   _|_________________________|_________________________________|
   1|       *User name:       |            weblogic             |
   2|     *User password:     |                                 |
   3| *Confirm user password: |                                 |
   4|      Description:       | The default administration user |
Select Option:
    1 - Modify "User name"
    2 - Modify "User password"
    3 - Modify "Confirm user password"
    4 - Modify "Description"
Enter option number to select OR [Exit][Previous][Next]> 2
<---------------------- BEA WebLogic Configuration Wizard ---------------------->
Configure Administrative Username and Password:
-----------------------------------------------
Create a user automatically assigned to the Administrative Role. This user is the default administrator used to start development mode servers.
    "*User password:" = []
Input new *User password: OR [Exit][Reset][Accept]> weblogic
<---------------------- BEA WebLogic Configuration Wizard ---------------------->
Configure Administrative Username and Password:
-----------------------------------------------
Create a user automatically assigned to the Administrative Role. This user is the default administrator used to start development mode servers.
    |          Name           |              Value              |
   _|_________________________|_________________________________|
   1|       *User name:       |            weblogic             |
   2|     *User password:     |            ********             |
   3| *Confirm user password: |                                 |
   4|      Description:       | The default administration user |
Select Option:
    1 - Modify "User name"
    2 - Modify "User password"
    3 - Modify "Confirm user password"
    4 - Modify "Description"
    5 - Discard Changes
Enter option number to select OR [Exit][Previous][Next]> 3
<---------------------- BEA WebLogic Configuration Wizard ---------------------->
Configure Administrative Username and Password:
-----------------------------------------------
Create a user automatically assigned to the Administrative Role. This user is the default administrator used to start development mode servers.
    |          Name           |              Value              |
   _|_________________________|_________________________________|
   1|       *User name:       |            weblogic             |
   2|     *User password:     |            ********             |
   3| *Confirm user password: |            ********             |
   4|      Description:       | The default administration user |
Select Option:
    1 - Modify "User name"
    2 - Modify "User password"
    3 - Modify "Confirm user password"
    4 - Modify "Description"
    5 - Discard Changes
Enter option number to select OR [Exit][Previous][Next]> 엔터
<---------------------- BEA WebLogic Configuration Wizard ---------------------->
Domain Mode Configuration:
--------------------------
Enable Development or Production Mode for this domain.
 ->1|Development Mode
   2|Production Mode
Enter index number to select OR [Exit][Previous][Next]> 엔터
<---------------------- BEA WebLogic Configuration Wizard ---------------------->
Java SDK Selection:
-------------------
 ->1|JRockit SDK 1.4.2_10-8160 @ /home/weblogic/bea/jrockit81sp6_142_10
   2|Sun SDK 1.4.2_11 @ /home/weblogic/bea/jdk142_11
   3|Other Java SDK
Enter index number to select OR [Exit][Previous][Next]> 엔터
<---------------------- BEA WebLogic Configuration Wizard ---------------------->
Select the target domain directory for this configuration:
----------------------------------------------------------
    "Target Location" = [/home/weblogic/bea/user_projects/domains]
Input new Target Location OR [Exit][Previous][Next]> 엔터 (or 원하는 디렉토리 입력)
<---------------------- BEA WebLogic Configuration Wizard ---------------------->
Edit Domain Information:
------------------------
    |  Name  |  Value   |
   _|________|__________|
   1| *Name: | mydomain |
Enter value for "Name" OR [Exit][Previous][Next]> 엔터 (or 원하는 도메인이름 입력)
<---------------------- BEA WebLogic Configuration Wizard ---------------------->
Creating Domain...
0%          25%          50%          75%          100%
[------------|------------|------------|------------]
[***************************************************]
**** Domain Created Successfully! ****

Start Admin Server

$ cd /home/weblogic/bea/user_projects/domains/mydomain
$ nohup ./startWebLogic.sh > /home/weblogic/bea/logs/nohupA.out &

Shutdown Admin Server

$ cd /home/weblogic/bea/user_projects/domains/mydomain
$ ./stopWebLogic.sh

Connect Weblogic Console

웹브라우저에서 http:아이피주소:7001/console 로 입력해서 접근한다. 위에서 config.sh 로 설정한 아이디/비밀번호로 로그인한다. ===== Managed Server ===== ==== Create ==== Console 메뉴에서 mydomain > Servers 를 선택하고, Configure a new Server… 를 클릭한다. Name 에 적당한 이름(MyServer-1)을 입력하고, 필요한 경우 Listen Address 를 입력하고, Listen Port를 원하는 값으로 입력한다. 마지막으로 Create 버튼을 클릭한다. 그러면 메뉴에서 mydomain > Servers 아래에 자신이 부여한 이름으로 Managed Server 가 생성된다. ==== Execute ==== 서버를 생성했다고 해서 끝이 난 것이 아니고, Shell Command 상에서 해당 Managed Server 를 실행해주어야 한다. <code bash> $ nohup ./startManagedWebLogic.sh MyServer-1 http://localhost:7001 & </code> ==== Shutdown ==== <code bash> $ /home/weblogic/bea/jdk142_11/bin/java -classpath /home/weblogic/bea/weblogic81/server/lib/weblogic.jar weblogic.Admin -url t3:localhost:7001 -username 아이디 -password 비밀번호 FORCESHUTDOWN MyServer-1 </code>

Start & Shutdowon 정리

위와 같이 Weblogic Admin, Managed Server 를 시작,종료가 상당히 번거로운것을 알 수 있다. 이를 좀 더 간편하게 하기 위해서 동길이가 제작한 스크립트를 소개한다. 물론 허락은 받지 않았지만, 조만간 허락을 받도록 하겠다. 적당히 잘 수정해서 쓰면 편할 것이다.

#!/bin/sh
 
###############################################################
BEA_PATH="/home/weblogic/bea"
WL_PATH="${BEA_PATH}/domains/mydomain"
ADMIN_IPADDR="211.214.219.248"
SERVICE_PORT="15000"
ADMIN_PORT="7001"
WL_BIN="startWebLogic.sh"
SERVER_BIN="${WL_PATH}/startManagedWebLogic.sh"
JAVA_BIN="/home/weblogic/bea/jdk142_11/bin/java"
WL_USER="weblogic"
WL_PASS="weblogic"
SERVERS="1 3 5"
SER_NUM="1|3|5"
ADMIN_SERVICE="myserver"
ADMIN_NOHUP="nohupA.out"
SERVICE_HEADER="beflytServer"
###############################################################
WL_JAR="${BEA_PATH}/weblogic81/server/lib/weblogic.jar"
 
weblogic_start() {
    SERVICE="${SERVICE_HEADER}${1}"
    FILENAME="nohupM${1}.out"
    echo "${SERVICE}(${SERVICE_PORT}) weblogic managed server starting... "
    if [ -e ${WL_PATH}/$FILENAME ] ; then
        mv ${WL_PATH}/$FILENAME "${WL_PATH}/logs/${FILENAME}.`date '+%y%m%d_%H%M%S'`"
    fi
    nohup ${SERVER_BIN} ${SERVICE} http://${ADMIN_IPADDR}:${ADMIN_PORT} > ${WL_PATH}/$FILENAME &
    echo ""
}
 
 
weblogic_stop() {
    SERVICE="${SERVICE_HEADER}$1"
    echo "${SERVICE}(${SERVICE_PORT}) weblogic managed server shutdown... "
    CMD="$JAVA_BIN -classpath $WL_JAR weblogic.Admin -url t3://${ADMIN_IPADDR}:${ADMIN_PORT} -username ${WL_USER} -password ${WL_PASS} FORCESHUTDOWN ${SERVICE}"
    echo ""
}
 
 
weblogic_admin_start() {
    SERVICE=${ADMIN_SERVICE}
    FILENAME=${ADMIN_NOHUP}
    echo "${SERVICE}(${ADMIN_PORT}) weblogic admin starting... "
    if [ -f ${WL_PATH}/${FILENAME} ] ; then
        mv ${WL_PATH}/${FILENAME} "${WL_PATH}/logs/${FILENAME}.`date '+%y%m%d_%H%M%S'`"
    fi
    nohup ${WL_PATH}/${WL_BIN} > ${WL_PATH}/${FILENAME} &
    $CMD
    echo ""
}
 
 
weblogic_admin_stop() {
    SERVICE=${ADMIN_SERVICE}
    echo "${SERVICE}(${ADMIN_PORT}) weblogic admin shutdown... "
    CMD="$JAVA_BIN -classpath $WL_JAR weblogic.Admin -url t3://${ADMIN_IPADDR}:${ADMIN_PORT} -username ${WL_USER} -password ${WL_PASS} FORCESHUTDOWN ${SERVICE}"
    $CMD
    echo ""
}
 
help() {
    echo "Usage: $0 {start|stop|restart} {${SER_NUM}|admin|all}"
}
 
case "$1" in
  start)
    case "$2" in
        all)
            for i in $SERVERS ; do weblogic_start $i ; sleep 10 ; done
            ;;
        admin)
            weblogic_admin_start
            ;;
        [$SER_NUM])
            weblogic_start $2
            ;;
        *)
            help
            ;;
    esac
    ;;
  stop)
    case "$2" in
        all)
            for i in $SERVERS ; do weblogic_stop $i ; done
            ;;
        admin)
            weblogic_admin_stop
            ;;
        [$SER_NUM])
            weblogic_stop $2
            ;;
        *)
            help
            ;;
    esac
    ;;
 
  restart)
    case "$2" in
        all)
            for i in $SERVERS ; do weblogic_stop $i ; done
            for i in $SERVERS ; do weblogic_start $i ; done
            ;;
        admin)
            weblogic_admin_stop
            weblogic_admin_start
            ;;
        [$SER_NUM])
            weblogic_stop $2
            weblogic_start $2
            ;;
        *)
            help
            ;;
    esac
    ;;
 
  *)
    help
    exit 1
esac
 
exit 0;

non-root User로 80(<1024)포트 서비스하는 방법

Introduction

In Linux, as a security precaution built into the kernel, only the root user can bind to a port below 1024. Thus, any webserver, ftp server etc needs to start up as root if only to bind to their standard socket numbers. On the other hand, having a running network server as root is in itself a bad idea, so most server software only remain as root for the time it takes them to establish the initial “listening” socket, then drop to a non-privileged user for the remainder of their operation.

Since Tomcat is written in Java, it does not have the ability to switch users like this - that's a rather platform specific thing to do. Below are a number of ways around this limitation, which allow Tomcat to serve requests received on port 80 (the standard web-server port) - or any other “privileged” port for that matter, without having to run it as the root user.

The Apache solution

I guess most people reading this article would already know of this option and have rejected it for their own reasons, but it's mentioned here for completeness' sake.

The most common solution is to run the Apache httpd as the web server, and configuring Apache and Tomcat in such a way that while Apache takes care of the port 80 stuff and serves static pages, CGI scripts and so on, all requests for JSPs or servlets get shunted over to Tomcat for processing. This is a rather popular configuration and is described elsewhere on the Jakarta website, so I won't describe it again here.

The IPTables solution

his solution allows Tomcat to run as an independent web server, using a non-privileged user, and still respond to port 80 on the server. It requires Linux with a kernel v2.4.x and iptables installed. If you have a 2.2 kernel, check the ipchains section at the end.

Modern Linux kernels have a very powerful infrastructure for filtering, translating and otherwise altering network packets as they arrive, get processed, or leave the computer. Frequently, this software (referred to as netfilter or iptables) is used to build firewalls or gateway configurations. If you've got any computer connected to the web, it's an extremely good idea to have a firewall in any case.

IPTables also allows you to do nifty things like redirecting all incoming packets on, say, port 80 (the default www port) to another port such as port 8080 (Tomcat's default port). In the rest of the section, I will be using these two ports - if your configuration uses a different port, please adjust the commands accordingly.

To do this redirection, two things are needed: To ensure that the firewall allows incoming requests to port 8080, and to redirect packets from port 80 to port 8080.

The first step is only needed if you have configured your firewall to protect your machine (and if you haven't done so, you should). Use your firewall-configuration software to accept incoming packets of type tcp and destination-port 8080. Essentially, you need a duplicate of the standard rule(s) for port 80, using port 8080.

The second step is to instruct IPTables to redirect all packets which arrive on port 80, to port 8080. This is done using the following command (as root):

# iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j REDIRECT --to-port 8080

The above command tells iptables to redirect all tcp packets with a destination port 80, coming in on network interface eth0, to the port 8080 (on the same machine). You will probably want to add this rule to the files used by your firewall configuration so that it is added automatically on booting.

Unfortunately this will not redirect local requests, since these bypass the PREROUTING chain. Thus, any browsers or other client software running on the server itself will either have to connect directly to port 8080, or something else must be used to redirect these local requests. While some servers might not require local requests to be redirected, keep in mind that this could affect local search engine software etc. For a solution to this issue, see the redirector section below.

The rinetd solution

Another simple solution is to use a dedicated port redirector, such as rinetd. This is a tiny program that simply receives a packet and redirects it to a different address or port. Since this processes packets after they've passed through IPtables, it can handle locally-originating requests too. All you have to do is install it, create a file /etc/rinetd.conf containing the line “xx.xx.xx.xx 80 xx.xx.xx.xx 8080” (where xx.xx.xx.xx is your IP address), and start it as a service. Rinetd will catch and redirect those requests which bypass the IPtables redirection rule.

You may wonder, why not use rinetd (or a similar port redirector) for all requests? Unfortunately rinetd has a significant problem - it makes all packets appear as if they originate on the local machine. This means that, in the web server access logs for instance, it will be impossible to differentiate between different visitors, or to set permissions based on IP addresses.

Used together, iptables and rinetd allow tomcat to run as a non-privileged user, while still serving requests arriving via port 80. Since rinetd will only be handling locally-originating requests, it doesn't affect the originating IP-address.

IPchains alternative

Kernels prior to v2.4 had a different packet filtering infrastructure - ipchains instead of iptables. The following command should accomplish the same things as the IPtables command described, but I never tried it:

# ipchains -I input --proto TCP --dport 80 -j REDIRECT 8080

그 외

Apache 와 연동하는 법, 클러스터 구성하는 법 등에 대해서는 필요시 다시 정리하겠다. 특히 클러스터를 구성을 하려면 L4가 있던지, Apache 와 연동이 되어 있어야 한다는 점은 알고 있어야겠다.

service/was/weblogic/install.1181548034.txt.gz · 마지막으로 수정됨: 2007/06/11 16:47 저자 mattabu