AWS

AWS : ์‹œ์ž‘ ํ…œํ”Œ๋ฆฟ ์ƒ์„ฑํ•˜๊ธฐ

NENGIN 2024. 11. 5. 20:49

โ— ํ…œํ”Œ๋ฆฟ = ๊ณจ๋“  ์ด๋ฏธ์ง€

โ—  AWS์—์„œ๋Š” ์ฃผ๋กœ ํ…œํ”Œ๋ฆฟ์ด๋ผ ๋ถˆ๋ฆผ

โ— ๋™์‹œ์— ์—ฌ๋Ÿฌ๋Œ€ ์ƒ์„ฑ ๊ฐ€๋Šฅ

 

1. ์‹œ์ž‘ํ…œํ”Œ๋ฆฟ ์ƒ์„ฑ

์ด๋ฆ„: LinuxTemplate / ๋ฒ„์ „ ์„ค๋ช…: v1
Quick Start <"Amazon Linux 2 AMI (HVM) x86"> ์„ ํƒ

mjmj, minjin ํ‚ค pem ํŒŒ์ผ ๋ถ„์‹ค์ด์Šˆ(^^)๋กœ real_mj ์ƒˆ๋กœ ์ƒ์„ฑํ•จ (24.11.04)

๊ณ ๊ธ‰ ๋„คํŠธ์›Œํฌ ๊ตฌ์„ฑ ์„ ํƒ ์žŠ์ง€๋ง๊ธฐ ~
ํผ๋ธ”๋ฆญ IP ์ž๋™ ํ• ๋‹น <"ํ™œ์„ฑํ™”">

#!/bin/bash
cat <<EOF> /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/\$basearch/
gpgcheck=0
enabled=1
EOF

sudo yum -y install nginx
sudo mv /usr/share/nginx/html/index.html  /usr/share/nginx/html/index.html.bak  
aws s3 cp s3://mj-s3-stroage/index.html /usr/share/nginx/html --region ap-northeast-2
sudo systemctl restart nginx 
sudo systemctl enable nginx

์บก์ฒ˜์‚ฌ์ง„์—์„œ๋Š” s3://mj-s3-stroage/index.html ๋ถ€๋ถ„์ด ja-s3๋กœ ๋˜์–ด์žˆ๋Š”๋ฐ

๋‚˜์˜ ์Šคํ† ๋ฆฌ์ง€๋ช…์„ ์ œ๋Œ€๋กœ ์ž…๋ ฅํ•ด์•ผ๋งŒ ์›ํ•˜๋Š” ์›นํŽ˜์ด์ง€๋ฅผ ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค.

์ด ๋ถ€๋ถ„ ๋•Œ๋ฌธ์— ์›นํŽ˜์ด์ง€์— ์ ‘์†๋˜์ง€ ์•Š์•„ ์‹œ์ž‘ํ…œํ”Œ๋ฆฟ๊ณผ ์ธ์Šคํ„ด์Šค๋ฅผ ์‚ญ์ œ ํ›„ ์žฌ์ƒ์„ฑํ–ˆ๋‹ค.

์ƒ์„ฑ ์™„๋ฃŒ

 

 

 

2. ์‹œ์ž‘ ํ…œํ”Œ๋ฆฟ์„ ์ด์šฉํ•œ ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ (EC2)

๊ฐ€์šฉ์˜์—ญ A ์— NGINX ์ธ์Šคํ„ด์Šค 2๊ฐœ ์ƒ์„ฑ

ํ…œํ”Œ๋ฆฟ์œผ๋กœ ์ธ์Šคํ„ด์Šค ์‹œ์ž‘ < ์„ ํƒ
์›๋ณธํ…œํ”Œ๋ฆฟ ์„ ํƒ > ์ธ์Šคํ„ด์Šค ๊ฐœ์ˆ˜ 2 ์ž…๋ ฅ
2๊ฐœ ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ ์™„๋ฃŒ

 

 

3. ์›น์„œ๋ฒ„ ๋™์ž‘ ํ™•์ธํ•˜๊ธฐ

๊ฐ ์ธ์Šคํ„ด์Šค์˜ public ip ์ฃผ์†Œ ํ™•์ธ

์›นํŽ˜์ด์ง€ ์ ‘์† ์„ฑ๊ณต (TCP 80)