์•ˆ๋…•ํ•˜์„ธ์š” ์ด์ •์šด ์ž…๋‹ˆ๋‹ค.

IBM ์—์„œ IBM WAS Liberty ๋ฅผ ์˜คํ”ˆ์†Œ์Šคํ™” ํ•˜์—ฌ ๋ˆ„๊ตฌ๋‚˜ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•˜๊ฒŒ Open Liberty ๋ผ๋Š” ์˜คํ”ˆ ์†Œ์Šค WAS ๋ฅผ ์ƒˆ๋กญ๊ฒŒ ์†Œ๊ฐœํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ๋ง์”€๋“œ๋ ค์„œ ์ƒ์šฉ IBM WAS Liberty ์™€ ๋™์ผ ์ฝ”๋“œ ๋ฒ ์ด์Šค๋กœ Open Liberty ๋ผ๋Š” ์ด๋ฆ„์œผ๋กœ Eclipse Public License ๊ธฐ๋ฐ˜์œผ๋กœ ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ๊ณต๊ฐœ(https://github.com/OpenLiberty) ํ•˜๊ณ  openliberty.io(https://openliberty.io)๋ฅผ ํ†ตํ•ด์„œ ๋‹ค์–‘ํ•œ ์ƒ˜ํ”Œ์ด๋‚˜ ๊ฐ€์ด๋“œ๋ฅผ ์ œ๊ณตํ•˜๋Š” ๋“ฑ ํ™œ๋ฐœํžˆ ๊ณต์œ ๋ฅผ ์‹œ์ž‘ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

Open Liberty๋Š” ๋‹ค์–‘ํ•œ ๊ธฐ์—…ํ™˜๊ฒฝ์—์„œ ๊ฒ€์ฆ๋œ ์ƒ์šฉ ์ˆ˜์ค€์˜ ํ’ˆ์งˆ๋กœ Java ํ‘œ์ค€์ธ Java EE ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ MicroProfile ์„ ์ง€์›ํ•˜๋Š” ์˜คํ”ˆ์†Œ์Šค WAS ๋กœ ํ–ฅํ›„ Cloud, Microservice Architecture, Container ๋กœ ๋ณ€ํ•ด๊ฐ€๋Š” ์‹œ๋Œ€์˜ ์ค‘์‹ฌ์ด ๋  ์ˆ˜ ์žˆ๋Š” WAS ๋กœ ์ž๋ฆฌ์žก๊ธฐ ์œ„ํ•œ ๊ทธ ์ฒซ๋ฒˆ์งธ ๋ฐœ๊ฑธ์Œ์ž…๋‹ˆ๋‹ค.

์˜คํ”ˆ ์†Œ์Šค์ด๊ธฐ ๋•Œ๋ฌธ์— Tomcat ์ฒ˜๋Ÿผ ๋ณ„๋„์˜ ๋ผ์ด์„ผ์Šค ์—†์ด ๋ˆ„๊ตฌ๋‚˜ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•˜๋ฉฐ ๋‹ค์–‘ํ•œ Cloud, Microservice Architecture, Container ์˜ ๊ธฐ๋ณธ WAS ๋ฏธ๋“ค
์›จ์–ด๋กœ ์–ธ์ œ๋“  ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜์‹ญ๋‹ˆ๋‹ค. ๊ทธ๋Ÿผ ๋ง๋งŒ์ด ์•„๋‹ˆ๋ผ ์ง์ ‘ ํ•œ๋ฒˆ ํ…Œ์ŠคํŠธ ํ•ด๋ณด๋Š” ์‹œ๊ฐ„์„ ๊ฐ€์ ธ๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

#1) openliberty.io ์—์„œ ์ง์ ‘ ๋‹ค์šด๋กœ๋“œ ๋ฐ ํ…Œ์ŠคํŠธ

https://openliberty.io/downloads/

๋งํฌ์—์„œ ๋‹ค์šด๋กœ๋“œ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ zip ํ˜•ํƒœ๋กœ ์••์ถ•๋˜์–ด ์žˆ๋Š” Open Liberty ์—”์ง„๊ณผ Eclipse Developer Tools ๋ฅผ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์Šต๋‹ˆ๋‹ค.
(๊ฐ„๋žตํžˆ๋งŒ ์„ค๋ช…๋“œ๋ฆฌ๋ฉด ์ด๋ฆ„ ๊ทธ๋Œ€๋กœ Open Liberty ํŒŒ์ผ์€ Open Liberty ์—”์ง„์„ ์˜๋ฏธํ•˜๋ฉฐ Eclipse Developer Tools ๋Š” Eclipse ์—์„œ Open Liberty ๋ฅผ ์—ฐ๋™ํ•˜๊ณ  ๊ฐœ๋ฐœํ•˜๊ธฐ ์œ„ํ•œ plugin ์ž…๋‹ˆ๋‹ค.)

Open Liberty ์˜ ๊ฒฝ์šฐ ๋ณ„๋„์˜ ์„ค์น˜ ์ž‘์—…์ด ํ•„์š”ํ•˜์ง€ ์•Š์œผ๋ฉฐ ํ•ด๋‹น zip ํŒŒ์ผ์— ๋Œ€ํ•œ ์••์ถ•์„ ํ’€๊ธฐ๋งŒ ํ•˜๋ฉด ์„ค์น˜๊ฐ€ ๋ชจ๋‘ ์™„๋ฃŒ๋œ ๊ฒƒ์ด๋ฉฐ ๋ฐ”๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (wlp ํด๋”๊ฐ€ ๊ธฐ๋ณธ ๋ฃจํŠธ ํด๋”๋กœ ๋ณด์‹œ๋ฉด ๋˜๋ฉฐ ๊ทธ ๋’ค์— ํ•„์š”ํ•œ ์Šคํฌ๋ฆฝํŠธ๋‚˜ ์„ค์ •, ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค.)

๊ทธ๋Ÿผ ์ด์ œ ์‹ค์ œ ๊ฐ„๋žตํ•˜๊ฒŒ ํ…Œ์ŠคํŠธ๋ฅผ ํ•˜๊ธฐ ์œ„ํ•ด์„œ Open Liberty ์ƒ˜ํ”Œ ์„œ๋ฒ„๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ๊ตฌ๋™ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. bin ๋””๋ ‰ํ† ๋ฆฌ์—์„œ “server” ๋ช…๋ น์–ด๊ฐ€ ์ž˜ ๋™์ž‘ํ•˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

server ๋ช…๋ น์–ด์˜ create ์ธ์ˆ˜๋ฅผ ํ†ตํ•ด์„œ server01 ์ด๋ผ๋Š” ์ƒ˜ํ”Œ ์„œ๋ฒ„๋ฅผ ํ•˜๋‹จ๊ณผ ๊ฐ™์ด ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

./server create server01

์ •์ƒ์ ์œผ๋กœ server create ๋ช…๋ น์ด ์™„๋ฃŒ๋˜๋ฉด ํ•˜๋‹จ๊ณผ ๊ฐ™์ด wlp\usr\servers\server01 ํด๋”๊ฐ€ ์ƒ์„ฑ๋œ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ Open Liberty ์˜ ๊ธฐ๋ณธ ์„ค์ •ํŒŒ์ผ์ธ server.xml ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

server.xml ์„ ํ™•์ธํ•ด๋ณด์‹œ๋ฉด ์•„์‹œ๊ฒ ์ง€๋งŒ ํ•˜๋‹จ๊ณผ ๊ฐ™์ด Open Liberty ๋ฅผ ์œ„ํ•œ ๊ฐ„๋‹จํ•œ ์„ค์ •๋“ค์ด ๋“ค์–ด๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

ํ–ฅํ›„ ์ข€ ๋” ์ž์„ธํžˆ ์„ค๋ช…ํ•˜๊ฒ ์ง€๋งŒ ๊ฐ„๋‹จํžˆ๋งŒ ์–ธ๊ธ‰๋“œ๋ฆฌ๋ฉด ‘featureManager’ ์—์„œ๋Š” ์–ด๋–ค ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ๊ฒƒ์ธ๊ฐ€์— ๋Œ€ํ•œ ๋ช…์„ธ์ด๋ฉฐ ๋ณด์‹œ๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ‘jsp-2.3’ ํ‘œ์ค€์„ ์‚ฌ์šฉํ•˜๊ฒ ๋‹ค๋Š” ์˜๋ฏธ์ž…๋‹ˆ๋‹ค. ์ด์™€ ๊ฐ™์ด Open Liberty ์—์„œ๋Š” Java EE ๋‚˜ ํŠน์ • ํ‘œ์ค€์„ ์œ„ํ•œ ์ปจํ…Œ์ด๋„ˆ๋งŒ ์„ธ๋ฐ€ํ•˜๊ฒŒ ๊ตฌ๋™ํ•˜๋Š” ๊ฒƒ์ด ๊ฐ€๋Šฅํ•˜์—ฌ ๋” ์ ์€ ๋ฉ”๋ชจ๋ฆฌ ํ’‹ํ”„๋ฆฐํŠธ ์‚ฌ์šฉ/๋” ๋น ๋ฅธ ์žฌ์‹œ์ž‘์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ์œผ๋กœ ‘httpEndpoint’ ๋Š” ์„œ๋น„์Šค๋ฅผ ์œ„ํ•œ http, https ํฌํŠธ์— ๋Œ€ํ•œ ์„ค์ •์ด ์กด์žฌํ•˜๋ฉฐ ์™ธ๋ถ€์—์„œ ์ ‘์†ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์ฃผ์„์— ์„ค๋ช…๋œ ๊ฒƒ๊ณผ ๊ฐ™์ด ‘host=”*”‘ ๊ตฌ๋ฌธ์„ ์ถ”๊ฐ€ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๋งˆ์ง€๋ง‰์œผ๋กœ ‘autoExpand’ ๊ด€๋ จ ์˜ต์…˜์€ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋ฐฐํฌํ• ๋•Œ WAR ๋‚˜ EAR ํŒŒ์ผ์„ ์‚ฌ์šฉํ•ด๋„ ์ž๋™์œผ๋กœ ์ด๋ฅผ ์ธ์ง€ํ•˜๊ณ  ํ’€์–ด์„œ ์‚ฌ์šฉํ•˜๊ฒ ๋‹ค๋Š” ์˜ต์…˜์ž…๋‹ˆ๋‹ค.

๊ทธ๋Ÿผ ๋Œ€๋žต์ ์œผ๋กœ ์„ค์ •์„ ํ™•์ธํ•ด๋ดค์œผ๋‹ˆ ‘./server start server01’ ๋ช…๋ น์„ ํ†ตํ•ด์„œ Open Liberty ์„œ๋ฒ„๋ฅผ ์‹ค์ œ๋กœ ์‹œ์ž‘์‹œํ‚ต๋‹ˆ๋‹ค.

์ •์ƒ์ ์œผ๋กœ server01 ์„œ๋ฒ„๊ฐ€ ์‹œ์ž‘์ด ์™„๋ฃŒ๋˜๋ฉด ํ•˜๋‹จ๊ณผ ๊ฐ™์ด ์›น๋ธŒ๋ผ์šฐ์ €์— ์ง€์ •๋œ port ๋ฅผ ํ†ตํ•ด์„œ Open Liberty ์„œ๋ฒ„์˜ Welcome ํŽ˜์ด์ง€๋ฅผ ํ™•์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

 

#2) Open Liberty ์„œ๋ฒ„๋ฅผ ํ™œ์šฉํ•œ ๊ฐ„๋‹จํ•œ ์ƒ˜ํ”Œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ํ…Œ์ŠคํŠธ

์ถ”๊ฐ€๋กœ ๊ฐ„๋‹จํ•œ JSP ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์ž‘์„ฑํ•˜๊ณ  Open Liberty ๋กœ ๊ตฌ๋™ํ•ด๋ณด๋Š” ๊ฒƒ์„ ์‚ดํŽด๋ณด๊ธฐ ์œ„ํ•˜์—ฌ ํ•˜๋‹จ๊ณผ ๊ฐ™์ด wlp/usr/servers/server01/apps ํด๋”์— ‘TestJSP’ ๋ผ๋Š” ๋นˆ ํด๋”๋ฅผ ํ•˜๋‚˜ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  ์ƒ์„ฑ๋œ ํด๋” ์•ˆ์— ํ•˜๋‹จ๊ณผ ๊ฐ™์ด ๊ฐ„๋‹จํ•œ ์ƒ˜ํ”Œ JSP ํŽ˜์ด์ง€๋ฅผ ํ•˜๋‚˜ ์ž‘์„ฑํ•˜์—ฌ test.jsp ๋ผ๋Š” ์ด๋ฆ„์œผ๋กœ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.

<html>
<head><title>First JSP</title></head>
<body>
<%
System.out.println(“Welcome JSP…”);
%>
<h2>Welcome JSP</p>
</body>
</html>

์ด๋ ‡๊ฒŒ ๊ฐ„๋‹จํ•œ ์ƒ˜ํ”Œ JSP ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋งŒ๋“ค์—ˆ๋‹ค๋ฉด ํ•˜๋‹จ๊ณผ ๊ฐ™์ด Open Liberty ์„œ๋ฒ„์˜ server.xml ํŒŒ์ผ์— ‘application’ ํ•ญ๋ชฉ์„ ์ถ”๊ฐ€ํ•˜์—ฌ ๋ฐฉ๊ธˆ ๋งŒ๋“  ํด๋”๋ฅผ ์ง€์ •ํ•˜๊ณ  ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์œผ๋กœ ์ธ์‹๋˜๊ฒŒ๋” ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.
(์ž˜ ๋ณด์‹œ๋ฉด Tomcat ์„ค์ • ๋ฐฉ์‹๊ณผ ๊ฑฐ์˜ ์œ ์‚ฌํ•˜๋‹ค๋Š” ๊ฒƒ์„ ์ดํ•ดํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.)

<?xml version=”1.0″ encoding=”UTF-8″?>
<server description=”new server”>

<!– Enable features –>
<featureManager>
<feature>jsp-2.3</feature>
</featureManager>

<!– To access this server from a remote client add a host attribute to the following element, e.g. host=”*” –>
<httpEndpoint id=”defaultHttpEndpoint”
httpPort=”9080″
httpsPort=”9443″ />

<!– Automatically expand WAR files and EAR files –>
<applicationManager autoExpand=”true”/>

<!– Application Sample –>
<application context-root=”Test” type=”war” id=”helloworld” location=”TestJSP” name=”TestJSP”/>
</server>

์ด์™€ ๊ฐ™์ด ํ•˜๋ฉด Open Liberty ์—์„œ ์ƒ˜ํ”Œ JSP ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์ž๋™์œผ๋กœ ์ธ์‹ํ•˜์—ฌ ์„ค์ •๋œ๋ฐ๋กœ Context Root ๋กœ ์ ‘์†ํ•˜๋ฉด ํ•ด๋‹น JSP ๊ฒฐ๊ณผ๋ฅผ ํ™•์ธํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋˜ํ•œ, ํ•ด๋‹น Open Liberty ์„œ๋ฒ„์˜ logs ํด๋”์˜ messages.log ํŒŒ์ผ์—์„œ JSP ์ƒ˜ํ”Œ์—์„œ ์ถœ๋ ฅํ•œ ๊ฐ„๋‹จํ•œ SystemOut ๊ด€๋ จ ๋กœ๊ทธ๋„ ํ™•์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

 

์ฐธ๊ณ  #1) Open Liberty ๋Š” WAS ์ด๊ธฐ ๋•Œ๋ฌธ์— ๋‹น์—ฐํžˆ ์‹คํ–‰ํ™˜๊ฒฝ์œผ๋กœ Java ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. IBM Java, Oracle Java, Open JDK ๋ชจ๋‘ ์ง€์›์ด ๊ฐ€๋Šฅํ•˜๋ฉฐ ์‚ฌ์ „์— JAVA_HOME ํŒจ์Šค ์„ค์ •๋งŒ์„ ํ•ด๋‘์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
(Open Liberty ์˜ ์ˆจ๊ฒจ์ง„ ์žฅ์ (?) ์ค‘์˜ ํ•˜๋‚˜๋Š” Windows ํ™˜๊ฒฝ์ด๋‚˜ Linux ํ™˜๊ฒฝ์—์„œ IBM Java ๋ฅผ ๊ณต์‹์ ์œผ๋กœ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ์ ์ž…๋‹ˆ๋‹ค.)

์ฐธ๊ณ  #2) ์ƒ˜ํ”Œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด WAR ๋‚˜ EAR ๋กœ ๋˜์–ด ์žˆ๋Š” ๊ฒฝ์šฐ์—๋„ ๋™์ผํ•˜๊ฒŒ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ wlp/dropins ์— WAR ๋‚˜ EAR ์„ ์˜ฎ๊ฒจ๋‘๊ธฐ๋งŒ ํ•ด๋„ ์ถ”๊ฐ€์ ์ธ server.xml ์„ค์ • ์—†์ด ์ž๋™์œผ๋กœ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์ธ์‹ํ•ด์„œ ๊ตฌ๋™์‹œํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
(๋‹จ, ์ด ๊ฒฝ์šฐ์— Context Root ๋Š” ๋ณ„๋„๋กœ ๋ณ€๊ฒฝํ•˜์ง€ ์•Š๋Š”ํ•œ WAR๋‚˜ EAR ํŒŒ์ผ์˜ ์ด๋ฆ„์ด ์ž๋™์œผ๋กœ Context Root ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค.)

ํ† ๋ก  ์ฐธ๊ฐ€

์ด๋ฉ”์ผ์€ ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ์ž…๋ ฅ์ฐฝ์€ * ๋กœ ํ‘œ์‹œ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.