1. 개요

OHS를 설치한다.


2. 설치

전체적인 설치 작업은 https://sarc.io/index.php/httpd/1509-ohs-oracle-http-server-12-1-2-0-0-silent-mode 와 동일하다.

$ ./fmw_12.2.1.3.0_ohs_linux64.bin -silent -responseFile /u01/installer/resp.txt -invPtrLoc /u01/installer/oraInst.loc
Launcher log file is /tmp/OraInstall2019-05-02_04-51-30PM/launcher2019-05-02_04-51-30PM.log.
Checking if CPU speed is above 300 MHz.   Actual 2596.990 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 3999 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 14819 MB    Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2019-05-02_04-51-30PM
Log: /tmp/OraInstall2019-05-02_04-51-30PM/install2019-05-02_04-51-30PM.log
Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Skipping Software Updates
Starting check : CertifiedVersions
Expected result: One of redhat-7, redhat-6, oracle-6, oracle-7, SuSE-11, SuSE-12
Actual Result: redhat-6.10
Check complete. The overall result of this check is: Passed
CertifiedVersions Check: Success.


Starting check : Packages
Checking for binutils-2.20.51.0.2; found binutils-2.20.51.0.2-5.48.el6_10.1-x86_64.     Passed
Checking for compat-libcap1-1.10; found compat-libcap1-1.10-1-x86_64.   Passed
Checking for compat-libstdc++-33-3.2.3-x86_64; found compat-libstdc++-33-3.2.3-69.el6-x86_64.   Passed
Checking for libgcc-4.4.4-x86_64; found libgcc-4.4.7-23.el6-x86_64.     Passed
Checking for libstdc++-4.4.4-x86_64; found libstdc++-4.4.7-23.el6-x86_64.       Passed
Checking for libstdc++-devel-4.4.4-x86_64; found libstdc++-devel-4.4.7-23.el6-x86_64.   Passed
Checking for sysstat-9.0.4; found sysstat-9.0.4-33.el6_9.1-x86_64.      Passed
Checking for gcc-4.4.4; found gcc-4.4.7-23.el6-x86_64.  Passed
Checking for gcc-c++-4.4.4; found gcc-c++-4.4.7-23.el6-x86_64.  Passed
Checking for make-3.81; found make-1:3.81-23.el6-x86_64.        Passed
Checking for glibc-2.12-x86_64; found glibc-2.12-1.212.el6_10.3-x86_64. Passed
Checking for glibc-devel-2.12-x86_64; found glibc-devel-2.12-1.212.el6_10.3-x86_64.     Passed
Checking for libaio-0.3.107-x86_64; found libaio-0.3.107-10.el6-x86_64. Passed
Checking for libaio-devel-0.3.107-x86_64; found libaio-devel-0.3.107-10.el6-x86_64.     Passed
Check complete. The overall result of this check is: Passed
Packages Check: Success.


Starting check : Kernel
Checking for VERSION=2.6.32; found VERSION=2.6.32-279.el6.x86_64.       Passed
Checking for hardnofiles=4096; found hardnofiles=4096.  Passed
Checking for softnofiles=4096; found softnofiles=4096.  Passed
Check complete. The overall result of this check is: Passed
Kernel Check: Success.


Starting check : TotalMemory
Expected result: 1024MB
Actual Result: 7868MB
Check complete. The overall result of this check is: Passed
TotalMemory Check: Success.


Starting check : CheckJDKVersion
Expected result: 1.8.0_131
Actual Result: 1.8.0_131
Check complete. The overall result of this check is: Passed
CheckJDKVersion Check: Success.


Validations are enabled for this session.
Verifying data
Copying Files
Percent Complete : 10
Percent Complete : 20
Percent Complete : 30
Percent Complete : 40
Percent Complete : 50
Percent Complete : 60
Percent Complete : 70
Percent Complete : 80
Percent Complete : 90
Percent Complete : 100

The installation of Oracle HTTP Server 12.2.1.3.0 completed successfully.
Logs successfully copied to /u01/oracle/oraInventory/logs.

이번 글에서는 일단 엔진 설치가 완료된 상태에서 도메인 추가를 해본다.


3. 도메인 추가

사일런트 모드에서의 도메인 추가를 위해 참고한 문서는 http://dirknachbar.blogspot.com/2017/04/silent-installation-and-configuration.html 이다.


4. 도메인 추가를 위한 필요 파일

4-1. setLocalEnv.sh

#
# Author: Dirk Nachbar
#
# http://dirknachbar.blogspot.com
#
# Environment Script for silent Standalone OHS Domain Creation
#
#
export SCRIPT_HOME=$PWD
export MW_HOME=/u01/oracle/ohs/122130
export WLST_HOME=$MW_HOME/oracle_common/common/bin
export JAVA_HOME=/u01/jdk18
export DOMAIN_NAME=ohs_domain
export DOMAIN_HOME=/u01/oracle/ohs/domains/$DOMAIN_NAME
export NM_LISTENADDRESS=`hostname -f`
export NM_TYPE=SSL
export NM_PORT=5557
export NM_USERNAME=nodemanager
export NM_PASSWORD=welcome1
export NM_HOME=$DOMAIN_HOME/nodemanager
export OHSINSTANCENAME=ohs1
export OHSADMINPORT=6999
export OHSHTTPPORT=6080
export OHSHTTPSPORT=6443

4-2. cr_ohs_domain.sh

#!/bin/sh
#
# Author: Dirk Nachbar
#
# http://dirknachbar.blogspot.com
#
# Shell Script Wrapper for Silent Standalone OHS Domain Creation
#

start_time=$(date +%s)

. $PWD/setLocalEnv.sh

echo "============================================="
echo " Program: cr_ohs_domain.sh              ....."
echo "============================================="

if [ -z "${WLST_HOME}" ]; then
   echo " Environment not correctly set - please verify"
   exit 1
fi

if ! test -d "${DOMAIN_HOME}"; then
   echo "============================================="
   echo " Domain will be installed               ....."
   echo "============================================="
   if [ -z "${MW_HOME}" -o -z "${JAVA_HOME}" -o -z "${DOMAIN_NAME}" -o -z "${DOMAIN_HOME}" -o -z "${NM_LISTENADDRESS}" -o -z "${NM_TYPE}" -o -z "${NM_PORT}" -o -z "${NM_USERNAME}" -o -z "${NM_PASSWORD}" -o -z "${NM_HOME}" -o -z "${OHSADMINPORT}" -o -z "${OHSHTTPPORT}" -o -z "${OHSHTTPSPORT}" ]; then
      echo " Environment not set - Exit"
      exit 1
   fi

   # In case we are facing problems with /dev/random
   export CONFIG_JVM_ARGS=-Djava.security.egd=file:/dev/./urandom:$CONFIG_JVM_ARGS

   ${WLST_HOME}/wlst.sh ${SCRIPT_HOME}/cr_ohs_domain.py

   # Set End Time
   finish_time=$(date +%s)
   echo "Finished"
   echo "Domain Build Time: $(( $((finish_time - start_time))/60))  minutes."
 else
   echo "Domain is already installed ..."
fi

4-3. cr_ohs_domain.py

#!/usr/bin/python
#
# Author: Dirk Nachbar
#
# http://dirknachbar.blogspot.com
#

import os, sys

v_mwHome=os.environ['MW_HOME']
v_jdkHome=os.environ['JAVA_HOME']
v_domainHome=os.environ['DOMAIN_HOME']
v_domainName=os.environ['DOMAIN_NAME']
v_NMUsername=os.environ['NM_USERNAME']
v_NMPassword=os.environ['NM_PASSWORD']
v_NMHome=os.environ['NM_HOME']
v_NMHost=os.environ['NM_LISTENADDRESS']
v_NMPort=os.environ['NM_PORT']
v_NMType=os.environ['NM_TYPE']
v_OHSInstanceName=os.environ['OHSINSTANCENAME']
v_OHSAdminPort=os.environ['OHSADMINPORT']
v_OHSHTTPPort=os.environ['OHSHTTPPORT']
v_OHSHTTPSPort=os.environ['OHSHTTPSPORT']

readTemplate(v_mwHome +'/wlserver/common/templates/wls/base_standalone.jar')
addTemplate(v_mwHome +'/ohs/common/templates/wls/ohs_standalone_template.jar')

cd('/')
create(v_domainName, 'SecurityConfiguration')
cd('SecurityConfiguration/' + v_domainName)
set('NodeManagerUsername',v_NMUsername)
set('NodeManagerPasswordEncrypted',v_NMPassword)
setOption('NodeManagerType', 'CustomLocationNodeManager');
setOption('NodeManagerHome', v_NMHome);
setOption('JavaHome', v_jdkHome )

cd('/Machines/localmachine/NodeManager/localmachine')
cmo.setListenAddress(v_NMHost);
cmo.setListenPort(int(v_NMPort));
cmo.setNMType(v_NMType);

delete(v_OHSInstanceName,'SystemComponent')
create (v_OHSInstanceName,'SystemComponent')
cd('/OHS/'+v_OHSInstanceName)
cmo.setAdminPort(v_OHSAdminPort)
cmo.setListenPort(v_OHSHTTPPort)
cmo.setSSLListenPort(v_OHSHTTPSPort)

writeDomain(v_domainHome)

4-4. 설치

$ ./cr_ohs_domain.sh
=============================================
 Program: cr_ohs_domain.sh              .....
=============================================
=============================================
 Domain will be installed               .....
=============================================

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Finished
Domain Build Time: 1  minutes.

4-5. py 파일 마개조 (멀티 인스턴스)

#!/usr/bin/python
#
# Author: Dirk Nachbar
#
# http://dirknachbar.blogspot.com
#

import os, sys

v_mwHome=os.environ['MW_HOME']
v_jdkHome=os.environ['JAVA_HOME']
v_domainHome=os.environ['DOMAIN_HOME']
v_domainName=os.environ['DOMAIN_NAME']
v_NMUsername=os.environ['NM_USERNAME']
v_NMPassword=os.environ['NM_PASSWORD']
v_NMHome=os.environ['NM_HOME']
v_NMHost=os.environ['NM_LISTENADDRESS']
v_NMPort=os.environ['NM_PORT']
v_NMType=os.environ['NM_TYPE']

v_OHSInstanceName1=os.environ['OHSINSTANCENAME1']
v_OHSAdminPort1=os.environ['OHSADMINPORT1']
v_OHSHTTPPort1=os.environ['OHSHTTPPORT1']
v_OHSHTTPSPort1=os.environ['OHSHTTPSPORT1']

v_OHSInstanceName2=os.environ['OHSINSTANCENAME2']
v_OHSAdminPort2=os.environ['OHSADMINPORT2']
v_OHSHTTPPort2=os.environ['OHSHTTPPORT2']
v_OHSHTTPSPort2=os.environ['OHSHTTPSPORT2']

readTemplate(v_mwHome +'/wlserver/common/templates/wls/base_standalone.jar')
addTemplate(v_mwHome +'/ohs/common/templates/wls/ohs_standalone_template.jar')

cd('/')
create(v_domainName, 'SecurityConfiguration')
cd('SecurityConfiguration/' + v_domainName)
set('NodeManagerUsername',v_NMUsername)
set('NodeManagerPasswordEncrypted',v_NMPassword)
setOption('NodeManagerType', 'CustomLocationNodeManager');
setOption('NodeManagerHome', v_NMHome);
setOption('JavaHome', v_jdkHome )

cd('/Machines/localmachine/NodeManager/localmachine')
cmo.setListenAddress(v_NMHost);
cmo.setListenPort(int(v_NMPort));
cmo.setNMType(v_NMType);

create(v_OHSInstanceName1,'SystemComponent')
cd('/OHS/'+v_OHSInstanceName1)
cmo.setAdminPort(v_OHSAdminPort1)
cmo.setListenPort(v_OHSHTTPPort1)
cmo.setSSLListenPort(v_OHSHTTPSPort1)

cd('/Machines/localmachine/NodeManager/localmachine')
cmo.setListenAddress(v_NMHost);
cmo.setListenPort(int(v_NMPort));
cmo.setNMType(v_NMType);

create(v_OHSInstanceName2,'SystemComponent')
cd('/OHS/'+v_OHSInstanceName2)
cmo.setAdminPort(v_OHSAdminPort2)
cmo.setListenPort(v_OHSHTTPPort2)
cmo.setSSLListenPort(v_OHSHTTPSPort2)

writeDomain(v_domainHome)

5. 기동

5-1. NodeAgent 기동

$ ./startNodeManager.sh
NODEMGR_HOME is already set to /u01/oracle/ohs/domains/ohs_domain/nodemanager
CLASSPATH=/u01/oracle/ohs/122130/oracle_common/jdk/jre/lib/tools.jar:/u01/oracle/ohs/122130/wlserver/server/lib/weblogic.jar:/u01/oracle/ohs/122130/wlserver/../oracle_common/modules/thirdparty/ant-contrib-1.0b3.jar:/u01/oracle/ohs/122130/wlserver/modules/features/oracle.wls.common.nodemanager.jar::/u01/oracle/ohs/122130/wlserver/..:/u01/oracle/ohs/122130/wlserver/modules/features/oracle.wls.common.grizzly.jar
+ /u01/oracle/ohs/122130/oracle_common/jdk/jre/bin/java -server -Xms32m -Xmx200m -Djdk.tls.ephemeralDHKeySize=2048 -Dcoherence.home=/u01/oracle/ohs/122130/wlserver/../coherence -Dbea.home=/u01/oracle/ohs/122130/wlserver/.. -Dweblogic.RootDirectory=/u01/oracle/ohs/domains/ohs_domain -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -Djava.security.policy=/u01/oracle/ohs/122130/wlserver/server/lib/weblogic.policy -Dweblogic.nodemanager.JavaHome=/u01/oracle/ohs/122130/oracle_common/jdk/jre weblogic.NodeManager -v
<May 2, 2019 5:58:38 PM KST> <INFO> <Loading domains file: /u01/oracle/ohs/domains/ohs_domain/nodemanager/nodemanager.domains>
<May 2, 2019 6:00:45 PM KST> <INFO> <Upgrade> <Setting NodeManager properties version to 12.2.1.3.0>
<May 2, 2019 6:00:45 PM KST> <INFO> <Upgrade> <Saving upgraded NodeManager properties to '/u01/oracle/ohs/domains/ohs_domain/nodemanager/nodemanager.properties'>
<May 2, 2019 6:00:45 PM KST> <INFO> <Loading domains file: /u01/oracle/ohs/domains/ohs_domain/nodemanager/nodemanager.domains>
<May 2, 2019 6:00:45 PM KST> <INFO> <Loading identity key store: FileName=/u01/oracle/ohs/domains/ohs_domain/security/DemoIdentity.jks, Type=jks, PassPhraseUsed=true>
<May 2, 2019 6:00:45 PM KST> <INFO> <Loaded NodeManager configuration properties from '/u01/oracle/ohs/domains/ohs_domain/nodemanager/nodemanager.properties'>
Node manager v12.2.1.3.0

Configuration settings:

DomainsFile=/u01/oracle/ohs/domains/ohs_domain/nodemanager/nodemanager.domains
LogLimit=0
DomainsDirRemoteSharingEnabled=false
AuthenticationEnabled=true
LogLevel=INFO
DomainsFileEnabled=true
ListenAddress=webtest3v
NativeVersionEnabled=true
ProcessDestroyTimeout=20000
ListenPort=5557
LogToStderr=true
SecureListener=true
LogCount=1
LogAppend=true
StateCheckInterval=500
CrashRecoveryEnabled=false
LogFile=/u01/oracle/ohs/domains/ohs_domain/nodemanager/nodemanager.log
LogFormatter=weblogic.nodemanager.server.LogFormatter
ListenBacklog=50
NodeManagerHome=/u01/oracle/ohs/domains/ohs_domain/nodemanager
RestEnabled=false
weblogic.startup.JavaHome=/u01/oracle/ohs/122130/oracle_common/jdk/jre
weblogic.startup.MW_Home=
coherence.startup.JavaHome=/u01/oracle/ohs/122130/oracle_common/jdk/jre
coherence.startup.MW_Home=

Domain name mappings:

ohs_domain -> /u01/oracle/ohs/domains/ohs_domain

<May 2, 2019 6:00:45 PM KST> <INFO> <Node manager v12.2.1.3.0>
<May 2, 2019 6:00:45 PM KST> <INFO> <Server Implementation Class: weblogic.nodemanager.server.NMServer$ClassicServer.>
<May 2, 2019 6:00:45 PM KST> <INFO> <Secure socket listener started on port 5557, host webtest3v/127.0.0.1>

5-2. Component 기동

$ ./startComponent.sh ohs1

그리고 패스워드 입력.

참고로 startComponent.sh나 stopComponent.sh를 실행하면 내부적으로 wlst.sh -> wlst_internal.sh 파일을 호출하게 된다.

만약 JVM 환경변수를 먹이고 싶다면,

setWlstEnv_internal.sh 파일을 보면 다음과 같다.

JVM_ARGS="${WLST_PROPERTIES} ${JVM_D64} ${UTILS_MEM_ARGS} ${CONFIG_JVM_ARGS}"
export WLST_PROPERTIES JVM_ARGS