본문 바로가기

AWS Cloud School

[05.17] 커스텀 AMI, ELB(ALB, NLB)

커스텀 AMI

 

 

 

 

 

ELB

 

 

ELB 실습 1, 2

 

tee /etc/systemd/system/tomcat.service <<EOF

[Unit]

Description=tomcat10

After=network.target syslog.target

 

[Service] 

Type=forking

Environment="/root/tomcat"

User=root

Group=root

ExecStart=/root/tomcat/bin/startup.sh

ExecStop=/root/tomcat/bin/shutdown.sh

 

[Install]

WantedBy=multi-user.target

EOF

 

 

 

cat <<EOF > index.jsp
<%@ page contentType="text/html; charset=UTF-8"%>
<html>
       <head><title>hello world</title></head>
       <body>
       <h2>
               TOMCAT TEST<br><br>
               time : <%= new java.util.Date()%>
               <%@ page import="java.net.InetAddress" %><br>
               <%InetAddress inet= InetAddress.getLocalHost();%>
               WAS ip : <%=inet.getHostAddress()%>
       </h2>
 
 
       </body>
</html>
EOF

 

 

 

 

ELB 실습 3