IBM WebSphere Liberty Core๋ฅผ GUI ์์ด Command Line(CLI) ํ๊ฒฝ์์ ์ค์นํ๊ณ , ์๋ฒ ์์ฑ ๋ฐ ๊ธฐ๋, ํต์ฌ ์ค์ (server.xml, JVM), ๊ทธ๋ฆฌ๊ณ ์น ์๋ฒ ์ฐ๋์ ์ํ ํ๋ฌ๊ทธ์ธ ์์ฑ(pluginUtility) ๊ณผ์ ์ ๋จ๊ณ๋ณ๋ก ์ ๋ฆฌํฉ๋๋ค.
1. ์ ํ ์ค์น (CLI Mode)
Liberty๋ Installation Manager(IM)์ imcl ๋ช
๋ น์ด๋ฅผ ํตํด ์ค์นํฉ๋๋ค. GUI๋ฅผ ์ฌ์ฉํ ์ ์๋ ๋ฆฌ๋
์ค/์ ๋์ค ์๋ฒ ํ๊ฒฝ์์ ํ์์ ์ธ ๋ฐฉ๋ฒ์
๋๋ค.
์ค์น ๋ช ๋ น์ด (imcl)
-repositories ์ต์
์๋ ์ค์น ํ์ผ(Repository)์ ๊ฒฝ๋ก๋ฅผ ์ง์ ํฉ๋๋ค. ์ฝค๋ง(,)๋ก ๊ตฌ๋ถํ์ฌ WAS์ JDK ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ๋์์ ์ง์ ํ ์ ์์ต๋๋ค.
# ์ค์น ์์ (Windows ๊ธฐ์ค, Linux๋ ๊ฒฝ๋ก๋ง ๋ณ๊ฒฝ)
imcl install com.ibm.websphere.liberty.v85_8.5.16002.20160526_2338 \
com.ibm.websphere.liberty.IBMJAVA.v80_8.0.3020.20161124_1304 \
-repositories "D:\Liberty\16.0.0.2-WS-LIBERTY-CORE,D:\work_file\was_install\v8.5.5\SDK\8.0.3.20" \
-installationDirectory "F:\app\IBM\wlpcore\AppServer" \
-acceptLicense \
-showProgress -sP
imcl listAvailablePackages -repositories [๊ฒฝ๋ก] ๋ช
๋ น์ด๋ก ๋ฏธ๋ฆฌ ํ์ธํด์ผ ํฉ๋๋ค.
2. ์๋ฒ ์๋ช ์ฃผ๊ธฐ ๊ด๋ฆฌ (Server Lifecycle)
์ค์น๊ฐ ์๋ฃ๋๋ฉด bin ๋๋ ํ ๋ฆฌ์ server ์คํฌ๋ฆฝํธ๋ฅผ ์ฌ์ฉํ์ฌ ์๋ฒ ์ธ์คํด์ค๋ฅผ ์์ฑํ๊ณ ์ ์ดํฉ๋๋ค.
1) ์๋ฒ ์์ฑ (Create)
cd [WLP_HOME]/bin
# ๊ตฌ๋ฌธ: server create [์๋ฒ๋ช
]
server.bat create test01
์์ฑ์ด ์๋ฃ๋๋ฉด [WLP_HOME]/usr/servers/test01 ๊ฒฝ๋ก์ ์ค์ ํ์ผ๋ค์ด ๋ง๋ค์ด์ง๋๋ค.
2) ์๋ฒ ๊ธฐ๋ ๋ฐ ์ํ ํ์ธ (Start/Status)
# ์๋ฒ ๊ธฐ๋
server.bat start test01
# ์ํ ํ์ธ (ํ์ ๊ฒ์ฆ ๋จ๊ณ)
server.bat status test01
3. ํต์ฌ ์ค์ (server.xml)
Liberty์ ๋ชจ๋ ๊ตฌ์ฑ์ server.xml ํ์ผ ํ๋์ ํตํฉ๋์ด ์์ต๋๋ค. ํ์ํ ๊ธฐ๋ฅ(Feature)๋ง ์ ์ธํด์ ์ฌ์ฉํ๋ ๊ตฌ์กฐ์
๋๋ค.
์ค์ ํ์ผ ์์น
[WLP_HOME]/usr/servers/[์๋ฒ๋ช ]/server.xml
์ฃผ์ ์ค์ ์์
<?xml version="1.0" encoding="UTF-8"?>
<server description="Test Server">
<!-- 1. Feature Manager: ํ์ํ ๊ธฐ๋ฅ ๋ชจ๋ ๋ก๋ -->
<featureManager>
<feature>jsp-2.2</feature>
<feature>jdbc-4.0</feature>
<feature>localConnector-1.0</feature> <!-- ๋ก์ปฌ ๊ด๋ฆฌ์ฉ -->
<feature>adminCenter-1.0</feature> <!-- ์น ๊ด๋ฆฌ ์ฝ์ -->
</featureManager>
<!-- 2. HTTP Endpoint: ํฌํธ ์ค์ -->
<!-- host="*"๋ ๋ชจ๋ IP ๋์ญ์์์ ์ ์์ ํ์ฉํจ -->
<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9080" httpsPort="9443">
<tcpOptions soReuseAddr="true" />
</httpEndpoint>
<!-- 3. Web Server Plugin ์ค์ -->
<pluginConfiguration webserverPort="80" webserverSecurePort="443"/>
<!-- 4. Application ๋ฐฐํฌ ์ค์ (์๋ ์ธ์์ด ํธํจ) -->
<applicationManager autoExpand="true"/>
<!-- 5. DB Connection (Oracle ์์) -->
<dataSource id="WorklightDS" jndiName="jdbc/WorklightDS">
<jdbcDriver libraryRef="OracleLib"/>
<properties.oracle
driverType="thin"
databaseName="ORCL"
serverName="localhost"
portNumber="1521"
user="SCOTT"
password="{xor}KDAtNDM2ODcr"/> <!-- securityUtility๋ก ์ํธํ ๊ถ์ฅ -->
</dataSource>
<!-- 6. Logging ์ค์ -->
<logging maxFiles="5" consoleLogLevel="INFO"/>
</server>
์ค์ ํ์ผ์
password="{xor}..." ๋ถ๋ถ์ ํ๋ฌธ์ ๊ทธ๋๋ก ๋ฃ์ง ์๊ณ , Liberty๊ฐ ์ ๊ณตํ๋ bin/securityUtility encode [์ํธ] ๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํ์ฌ ์ธ์ฝ๋ฉ๋ ๊ฐ์ ๋ฃ์ด์ผ ๋ณด์์ ์์ ํฉ๋๋ค.
4. ํ๊ฒฝ ๋ณ์ ๋ฐ JVM ์ต์ ์ค์
๋ฉ๋ชจ๋ฆฌ(Heap) ์ค์ ์ด๋ ๋ก๊ทธ ๊ฒฝ๋ก ๋ณ๊ฒฝ ๋ฑ์ ๋ณ๋์ ์ค์ ํ์ผ์์ ๊ด๋ฆฌํฉ๋๋ค.
1) JVM ์ต์ (jvm.options)
Heap Size๋ GC ๋ก๊ทธ ์ค์ ์ jvm.options ํ์ผ์ ๋ผ์ธ ๋จ์๋ก ์์ฑํฉ๋๋ค.
- ์์น:
[WLP_HOME]/usr/servers/[์๋ฒ๋ช ]/jvm.options
# Heap Memory ์ค์
-Xms512m
-Xmx1024m
# GC ๋ก๊ทธ ์ค์
-verbose:gc
-Xverbosegclog:verbosegc.log
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintHeapAtGC
2) ํ๊ฒฝ ๋ณ์ (server.env)
JAVA_HOME ์ง์ ์ด๋ ์ปค์คํ
๋ก๊ทธ ๊ฒฝ๋ก๋ server.env์ ์ ์ํฉ๋๋ค.
# Java ๋ฒ์ ์ง์
JAVA_HOME=C:\Java\jdk1.8.0
# ๋ก๊ทธ ๊ฒฝ๋ก ๋ณ๊ฒฝ (Optional)
WLP_OUTPUT_DIR=F:\app\IBM\wlpcore\AppServer\usr\logs\test02
5. ์น ์๋ฒ ํ๋ฌ๊ทธ์ธ (Plugin) ์์ฑ
Liberty ์๋ฒ ์๋จ์ IHS(Apache)๋ฅผ ๋๋ค๋ฉด, plugin-cfg.xml์ ์์ฑํ์ฌ ์น ์๋ฒ์ ์๋ ค์ฃผ์ด์ผ ํฉ๋๋ค.
ํ๋ฌ๊ทธ์ธ ์์ฑ ๋๊ตฌ (pluginUtility)
Liberty 16.0.0.4 ๋ฒ์ ๋ถํฐ pluginUtility ๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํฉ๋๋ค.
cd [WLP_HOME]/bin
# 1. ๋ก์ปฌ ์๋ฒ์ฉ ํ๋ฌ๊ทธ์ธ ์์ฑ
pluginUtility generate --server=test01 --targetpath=./plugin-cfg.xml
# 2. ์๊ฒฉ ์๋ฒ์ฉ ํ๋ฌ๊ทธ์ธ ์์ฑ (Admin Center ๊ธฐ๋ฅ ํ์)
pluginUtility generate --server=admin:password@remoteHost:9443 --targetpath=./plugin-cfg.xml
# 3. ์ฌ๋ฌ ํ๋ฌ๊ทธ์ธ ๋ณํฉ (Merge)
pluginUtility merge --sourcepath=../usr/plugin --targetpath=../usr/merged_plugin.xml
์น ์๋ฒ(httpd.conf) ์ ์ฉ
์์ฑ๋ xml ํ์ผ์ ์น ์๋ฒ๋ก ๋ณต์ฌํ ํ httpd.conf์ ๋ฑ๋กํฉ๋๋ค.
# Windows ์์
LoadModule was_ap22_module "C:\IBM\HTTPServer\plugins\bin\mod_was_ap22_http.dll"
WebSpherePluginConfig "C:\IBM\HTTPServer\plugins\config\webserver1\plugin-cfg.xml"
# Linux/Unix ์์
LoadModule was_ap22_module "/opt/IBM/HTTPServer/plugins/bin/mod_was_ap22_http.so"
WebSpherePluginConfig "/opt/IBM/HTTPServer/plugins/config/webserver1/plugin-cfg.xml"
Next Step:
๊ธฐ๋ณธ ์ค์น์ ์ค์ ์ด ๋๋ฌ๋ค๋ฉด, adminCenter ๊ธฐ๋ฅ์ ํ์ฑํํ๊ณ ๋ธ๋ผ์ฐ์ (https://localhost:9443/adminCenter)๋ก ์ ์ํ์ฌ GUI ํ๊ฒฝ์์ ์๋ฒ ์ํ๋ฅผ ๋ชจ๋ํฐ๋งํด ๋ณด์ญ์์ค.
