목차

Install Weblogic

Install Debian Packages

Weblogic 9, 10 의 경우에는 아래 패키지를 먼저 설치해야 정상적으로 동작한다.

# apt-get install gnome

Create Account weblogic on Linux

# 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

# 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/92/server921_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]> 엔터
# 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/bin
$ nohup ./startWebLogic.sh > /home/weblogic/bea/logs/nohupA.log &

Shutdown Admin Server

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

Connect Weblogic Console

웹브라우저에서 http:아이피주소:7001/console 로 입력해서 접근한다. 위에서 config.sh 로 설정한 아이디/비밀번호로 로그인한다. ===== Managed Server ===== ==== Create ==== Console 메뉴에서 mydomain > Servers 를 선택하고, Configure a new Server… 를 클릭한다. Name 에 적당한 이름(Server-0)을 입력하고, 필요한 경우 Listen Address 를 입력하고, Listen Port를 원하는 값으로 입력한다. 마지막으로 Create 버튼을 클릭한다. 그러면 메뉴에서 mydomain > Servers 아래에 자신이 부여한 이름으로 Managed Server 가 생성된다. ==== Startup ==== 서버를 생성했다고 해서 끝이 난 것이 아니고, Shell Command 상에서 해당 Managed Server 를 실행해주어야 한다. <code bash> $ cd /home/weblogic/bea/user_projects/domains/mydomain/bin $ nohup ./startManagedWebLogic.sh Server-0 http://localhost:7001 > /home/weblogic/bea/logs/nohupM0.log & </code> 만약 Managed Server 가 실행되지 않는다면, 운영모드인지 확인하고, cd /home/weblogic/bea/user_projects/domains/mydomain/ 에 boot.properties 파일이 있는지 확인한다. boot.properties 파일이 없다면 아래내용을 입력한후 저장하고, Managed Server 를 실행시킨다. <code> username=사용자아이디 password=비밀번호 </code> ==== Shutdown ==== <code bash> $ /home/weblogic/bea/jdk150_06/bin/java -classpath /home/weblogic/bea/wlserver_10.0/server/lib/weblogic.jar weblogic.Admin -url t3:localhost:7001 -username 아이디 -password 비밀번호 FORCESHUTDOWN Server-0 </code> 또는

$ cd /home/weblogic/bea/domains/test_domain/bin
$ ./stopManagedWeblogic.sh Server-0 t3://localhost:7001 아이디 비밀번호

Start & Shutdowon 정리

#!/bin/sh
# 
# desc : weblogic admin/manage service start/stop scripts
# starlits@adminschool.net
# 
 
###############################################################
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;