# setDomain.sh
#!/bin/bash
SYSTEM_ID=`echo ${PWD##*/} | sed s/domain//g`
DOMAIN_NAME=webDomain
DOMAIN_HOME=/was/domains/${DOMAIN_NAME}
LOG_DIR=/log/weblogic/${SYSTEM_ID}/${SERVER_NAME}
ADMIN_URL="t3://host명:12100"
DEFAULT_LOG_PFX="${LOG_DIR}/stdout.log."
export ADMIN_URL DEFAULT_LOG_PFX
# WAS Options
USER_MEM_ARGS="${USER_MEM_ARGS} -D${SERVER_NAME}"
USER_MEM_ARGS="${USER_MEM_ARGS} -Dweblogic.system.BootIdentityFile=${DOMAIN_HOME}/boot.properties"
USER_MEM_ARGS="${USER_MEM_ARGS} -Dweblogic.MuxerClass=weblogic.socket.PosixSocketMuxer"
USER_MEM_ARGS="${USER_MEM_ARGS} -Dweblogic.SelfTuningThreadPoolSizeMin=50"
USER_MEM_ARGS="${USER_MEM_ARGS} -Dweblogic.PrintStackTraceInProduction=true"
USER_MEM_ARGS="${USER_MEM_ARGS} -Doracle.jdbc.fanEnabled=false"
# GC Options
USER_MEM_ARGS="${USER_MEM_ARGS} -XX:+UseG1GC"
USER_MEM_ARGS="${USER_MEM_ARGS} -XX:+PrintGCDetails"
USER_MEM_ARGS="${USER_MEM_ARGS} -XX:+PrintGCTimeStamps"
USER_MEM_ARGS="${USER_MEM_ARGS} -verbose:gc"
USER_MEM_ARGS="${USER_MEM_ARGS} -Xloggc:${LOG_DIR}/gc/${SERVER_NAME}_GC.log.`date '+20%y%m%d_%H%M%S'`"
# Dump Options
USER_MEM_ARGS="${USER_MEM_ARGS} -XX:+HeapDumpOnOutOfMemoryError"
USER_MEM_ARGS="${USER_MEM_ARGS} -XX:HeapDumpPath=${DOMAIN_HOME}"
# ETC Options
USER_MEM_ARGS="${USER_MEM_ARGS} -Djava.net.preferIPv4Stack=true"
USER_MEM_ARGS="${USER_MEM_ARGS} -Djava.security.egd=file:///dev/urandom"
USER_MEM_ARGS="${USER_MEM_ARGS} -Dfile.encoding=UTF-8"
exprot USER_MEM_ARGS
# startWeb01_i01.sh
#!/bin/bash
SERVER_NAME=`echo $0 | sed 's/.sh//g' | sed 's/.\///g' | sed 's/start//g'`
. ./setDomain.sh
USER_MEM_ARGS="-D${SERVER_NAME} -Xms1g -Xmx1g -XX:+HeapDumpOnOutOfMemoryError ${USER_MEM_ARGS}"
JAVA_OPTIONS="${JAVA_OPTIONS} -Dfile.encoding=UTF-8"
export USER_MEM_ARGS JAVA_OPTIONS
nohup ./bin/startManagedWebLogic.sh ${SERVER_NAME} ${ADMIN_URL} 2>&1 | ./LOGS.pl ${DEFAULT_LOG_PFX} &
echo "tail -f ${DEFAULT_LOG_PFX}`date +%Y%m%d`"
# LOGS.pl
#!/usr/bin/perl
$TRUE=1;
$FALSE=0;
$DEBUG=$FALSE;
$DEFAULT_LOG_PFX=$ARGV[0];
$logPfx=$DEFAULT_LOG_PFX;
$ignoreConsole=$FALSE;
while($aLine = <STDIN>) {
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time());
$logFile=$logPfx.sprintf("%04d%02d%02d",($year+1900),($mon+1),$mday,$hour,$min,$sec);
open(logH,">> $logFile");
# Auto flash ON
select((select(logH),$|=1)[0]);
# use IO::Handle;
# logH->autoflush($TRUE);
print logH $aLine;
if($ignoreConsole) {
print $aLine;
}
close(logH);
}
# stopWeb01_i01.sh
#!/bin/bash
SERVER_NAME=`echo $e | sed 's/.sh//g' | sed 's/.\///g' | sed 's/stop//g'`
PROCESS_ID=`ps -ef | grep java | grep -v grep | grep 사용자계정ID | grep -w D${SERVER_NAME} | awk '{print $2}'`
ps -ef | grep java | grep -v grep | grep 사용자계정ID | grep -w D${SERVER_NAME} | awk '{print $2}' | xargs kill -9
echo "#####" ${SERVER_NAME} "==" ${PROCESS_ID} "== kill"
==========================================================================================
Weblogic 12C
* /WEB-INF/weblogic.xml 설명
URL : https://docs.oracle.com/middleware/12212/wls/WBAPP/weblogic_xml.htm
- weblogic.xml 샘플
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
<context-root>/</context-root>
<session-descriptor>
<persistent-store-type>replicated_if_clustered</persistent-store-type>
<sharing-enabled>true</sharing-enabled>
</session-descriptor>
<container-descriptor>
<prefer-application-packages>
<package-name>org.slf4j</package-name>
<package-name>log4j</package-name>
</prefer-application-packages>
<prefer-application-resources>
<resource-name>com.sun.faces.*</resource-name>
</prefer-application-resources>
</container-descriptor>
</weblogic-web-app>
* /META-INF/application.xml 설명
URL : https://docs.oracle.com/middleware/1212/wls/WLPRG/app_xml.htm
* Command Deploy
- deploy (war)
java -cp "C:\Oracle\Middleware\Oracle_Home\wlserver\server\lib\weblogic.jar" \
weblogic.Deployer -adminurl t3://127.0.0.1:7001 \
-username weblogic -password weblogic1 \
-deploy C:\dev\workspaces\eclipse-jee-2018-09-win32-x86_64\pubfreq\build\libs\pubfreq.war
- deploy (folder)
java -cp "C:\Oracle\Middleware\Oracle_Home\wlserver\server\lib\weblogic.jar" \
weblogic.Deployer -adminurl t3://127.0.0.1:7001 \
-username weblogic -password weblogic1 \
-deploy C:\dev\workspaces\eclipse-jee-2018-09-win32-x86_64\pubfreq\build\libs\pubfreq
- undeploy
java -cp "C:\Oracle\Middleware\Oracle_Home\wlserver\server\lib\weblogic.jar" \
weblogic.Deployer -adminurl t3://127.0.0.1:7001 \
-username weblogic -password weblogic1 -undeploy -name pubfreq
* 아래와 같은 오류 발생 시
<2019. 1. 8 오후 10시 04분 52초 KST> <Error> <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Unknow type constant pool 18 at position 14>
<2019. 1. 8 오후 10시 04분 52초 KST> <Error> <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Unknow type constant pool 0 at position 15>
<2019. 1. 8 오후 10시 04분 52초 KST> <Error> <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Unknow type constant pool 0 at position 16>
<2019. 1. 8 오후 10시 04분 52초 KST> <Error> <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Unknow type constant pool 0 at position 17>
<2019. 1. 8 오후 10시 04분 52초 KST> <Error> <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Unknow type constant pool 81 at position 18>
<2019. 1. 8 오후 10시 04분 52초 KST> <Error> <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Unknow type constant pool 15 at position 81>
<2019. 1. 8 오후 10시 04분 52초 KST> <Error> <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Unknow type constant pool 97 at position 84>
- "com.sun.faces.*" 부분 추가
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
<container-descriptor>
<prefer-application-resources>
<resource-name>javax.faces.*</resource-name>
<!-- 이 부분 추가 -->
<resource-name>com.sun.faces.*</resource-name>
<resource-name>com.bea.faces.*</resource-name>
</prefer-application-resources>
</container-descriptor>
</weblogic-web-app>
=========================================================================================================
다운로드 : http://www.oracle.com/
http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html
참고 : http://antop.tistory.com/132
http://blog.naver.com/jadin1/70117413544 (Admin 서버외의 Managed Server 구성 )
1. zip 파일 버전을 다운로드 후 압축을 해제한다.
2. 시스템 PATH 설정을 한다.
MW_HOME=압축해제 폴더
3. cmd 에서 실행
// 웹로직 설정 프로그램 실행
d:\weblogic>configure.cmd
// 웹로직 환경 적용
%MW_HOME%\wlserver\server\bin\setWLSEnv.cmd
// 도메인 생성
%MW_HOME%/wlserver/common/bin/config.cmd
4. 콘솔 한글 깨짐 수정 (UTF-8 설정)
웹로직 폴더\user_projects\domains\서버 도메인\bin\setDomainEnv.cmd 에서 UTF-8 부분 추가
set JAVA_PROPERTIES=-Dplatform.home=%WL_HOME% \
-Dwls.home=%WLS_HOME% -Dweblogic.home=%WLS_HOME% \
-Dwli.home=%WLI_HOME% -Dfile.encoding=UTF-8 -Dfile.client.encoding=UTF-8
* WebLogic 콘솔(관리자) URL
http://localhost:7001/console/
* WebLogic Port 변경
웹로직 폴더\user_projects\domains\서버 도메인\config\config.xml 에서 빨간색 부분 추가
<server> <name>AdminServer</name> <listen-port>7000</listen-port> <listen-address/> </server> |
* 도메인 삭제
1. Domain 디렉토리 삭제
rm $WLS_HOME/user_projects/domains/$DOMAIN_NAME
2. nodemanager.domains 파일 수정
$WLS_HOME/wlserver/common/nodemanager/nodemanager.domains 파일을 수정
삭제한 domain의 이름으로 되어 있는 property를 삭제
3. domain-registry.xml
$WLS_HOME/domain-registry.xml 파일을 수정
Domain 이름이 없으니 해당되는 경로만 삭제
* 2개 이상의 도메인 실행 설정
1. 위에 WebLogic Port 변경 부분에서 포트를 도메인별로 할당한다.
2. $WLS_HOME/user_project/domains/$DOMAIN_NAME/bin/setDomainEnv.cmd에서 빨간색 부분 포트 변경
if "%DEBUG_PORT%"=="" (
set DEBUG_PORT=8453
)