AWS

[AWS] EC2 ๊ณ„์ • ๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ ํ•˜๋Š” ๋ฐฉ๋ฒ•

martinooo 2024. 9. 27. 13:22

AWS

 

 

 

 

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œ


AWS EC2 ์ธ์Šคํ„ด์Šค์— SSH๋กœ ์ ‘์†ํ•˜์—ฌ ๊ณ„์ • ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋ณ€๊ฒฝํ•ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ๊ธ€์—์„œ๋Š” EC2 ๊ณ„์ •์˜ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๊ฐ„ํŽธํ•˜๊ฒŒ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

๊ฟ€ํŒ!

์ด ๋ช…๋ น์–ด๋ฅผ ๋งค๋ฒˆ ๊ธฐ์–ตํ•˜๊ธฐ ์–ด๋ ค์šฐ๋ฏ€๋กœ ์ด ๊ธ€์„ ์ฆ๊ฒจ์ฐพ๊ธฐ์— ์ถ”๊ฐ€ํ•˜์—ฌ EC2 ๊ณ„์ • ๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ ์‹œ ์ฐธ๊ณ ํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

 

 

[NestJS] AWS Parameter Store AWS-SDK ํ”„๋กœ์ ํŠธ 2ํƒ„

2024.09.05 - [Nest.js] - [NestJS] AWS Parameter Store ํ”„๋กœ์ ํŠธ 2ํƒ„

 

[NestJS] AWS Parameter Store ํ”„๋กœ์ ํŠธ 2ํƒ„

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œ์ด์ „ ๊ธ€์—์„œ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋ฅผ ์ค‘์•™ ๊ด€๋ฆฌ ํ•˜๋Š” ์ด์œ ์™€ AWS Parameter Store ๊ฐœ๋…๊ณผ ์žฅ์ ์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ดค์Šต๋‹ˆ๋‹ค.์ด๋ฒˆ ๊ธ€์—์„œ๋Š” ์‹ค๋ฌด์—์„œ Parameter Store ํŒŒ๋ผ๋ฏธํ„ฐ ๊ฐ’๋“ค์„ ์ƒ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•

cometruedream.tistory.com

 

[NestJS] AWS Parameter Store AWS-SDK ํ”„๋กœ์ ํŠธ 1ํƒ„

2024.09.04 - [Nest.js] - [NestJS] AWS Parameter Store ํ”„๋กœ์ ํŠธ 1ํƒ„

 

[NestJS] AWS Parameter Store ํ”„๋กœ์ ํŠธ 1ํƒ„

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋‹ค ๋ณด๋ฉด ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๊ด€๋ฆฌ๊ฐ€ ์–ด๋ ค์›Œ์ง‘๋‹ˆ๋‹ค.ํ”„๋กœ์ ํŠธ ์‚ฌ์ด์ฆˆ๊ฐ€ ์ปค์ง€๋ฉด ๋”์šฑ๋” ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๊ด€๋ฆฌ๊ฐ€ ์–ด๋ ค์›Œ์ง€๊ธฐ ๋•Œ๋ฌธ์— ์ด๋ฒˆ ๋ฒ ํƒ€์„œ๋น„์Šค๊นŒ์ง€ ๊ฐœ๋ฐœ์„ ์™„๋ฃŒํ•˜๊ณ  A

cometruedream.tistory.com

 

๐Ÿคท‍โ™‚๏ธ 1. EC2 SSH ์ ‘์†ํ•˜๊ธฐ


๋จผ์ € EC2 ์ธ์Šคํ„ด์Šค์— SSH๋กœ ์ ‘์†ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

AWS EC2์— SSH๋กœ ์ ‘์†ํ•˜๋ ค๋ฉด ์ธ์Šคํ„ด์Šค๊ฐ€ ์‹คํ–‰ ์ค‘์ด์–ด์•ผ ํ•˜๋ฉฐ ์ ‘๊ทผ์„ ์œ„ํ•ด ๊ณต๊ฐœ IP ์ฃผ์†Œ or ํผ๋ธ”๋ฆญ DNS  or. pem ํ‚ค ํŒŒ์ผ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

 

SSH ์ ‘์† ๋ช…๋ น์–ด

ssh -i /path/to/your-key.pem ec2-user@your-ec2-public-ip

 

  • /path/to/your-key.pem: EC2 ์ธ์Šคํ„ด์Šค๋ฅผ ์ƒ์„ฑํ•  ๋•Œ ์‚ฌ์šฉํ•œ. pem ํ‚ค ํŒŒ์ผ์˜ ๊ฒฝ๋กœ.
  • ec2-user: ์ผ๋ฐ˜์ ์œผ๋กœ Amazon Linux๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ด๋ฆ„. Ubuntu๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ ubuntu์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • your-ec2-public-ip: EC2 ์ธ์Šคํ„ด์Šค์˜ ํผ๋ธ”๋ฆญ IP ์ฃผ์†Œ ๋˜๋Š” ํผ๋ธ”๋ฆญ DNS.

 

 

๐Ÿคท‍โ™‚๏ธ 2. root ๊ถŒํ•œ์œผ๋กœ ์ „ํ™˜


EC2 SSH ์ ‘์†ํ›„์— ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋ณ€๊ฒฝํ•˜๋ ค๋ฉด root ๊ถŒํ•œ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

SSH ์ ‘์†ํ›„์— sudo ๋ช…๋ น์–ด๋กœ ๋ฃจํŠธ ๊ถŒํ•œ์„ ์–ป์Šต๋‹ˆ๋‹ค.

 

root ๊ถŒํ•œ์œผ๋กœ ์ „ํ™˜ ๋ช…๋ น์–ด

sudo su -

 

๐Ÿคท‍โ™‚๏ธ 3. EC2 ๊ณ„์ • ๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ


EC2 SSH ์ ‘์† ํ›„ root ๊ถŒํ•œ์œผ๋กœ ์ „ํ™˜๊นŒ์ง€ ํ•˜์…จ๋‹ค๋ฉด ์ด์ œ EC2 ์‚ฌ์šฉ์ž ๊ณ„์ •์„ ์„ ํƒํ•˜์—ฌ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋ณ€๊ฒฝํ• ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ ๋ช…๋ น์–ด

passwd your-username
  • your-username: ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋ณ€๊ฒฝํ•˜๋ ค๋Š” ์‚ฌ์šฉ์ž ๊ณ„์ • ์ด๋ฆ„.

 

์ด ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ์ƒˆ๋กœ์šด ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜๋ผ๋Š” ๋ฉ”์‹œ์ง€๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

์ƒˆ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋‘ ๋ฒˆ ์ž…๋ ฅํ•˜์—ฌ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

 

๐Ÿคท‍โ™‚๏ธ 4. EC2 ๊ณ„์ • ๋น„๋ฐ€๋ฒˆํ˜ธ ํ™•์ธ 


๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝํ•œ ํ›„ ๋ณ€๊ฒฝํ•œ ๊ณ„์ •์œผ๋กœ ๋‹ค์‹œ ๋กœ๊ทธ์ธํ•˜๊ฑฐ๋‚˜ su ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•ด ์ƒˆ ๋น„๋ฐ€๋ฒˆํ˜ธ๋กœ ๊ณ„์ •์— ์ ‘์†ํ•˜์—ฌ ๋น„๋ฐ€๋ฒˆํ˜ธ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋ณ€๊ฒฝ์ด ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

 

๊ณ„์ • ๋น„๋ฐ€๋ฒˆํ˜ธ ํ™•์ธ

su - your-username

 

 

๐Ÿคท‍โ™‚๏ธ 4. SSH ์„ค์ • ํ™•์ธ (Optional) 


๋น„๋ฐ€๋ฒˆํ˜ธ ๋กœ๊ทธ์ธ์€ ๊ธฐ๋ณธ์ ์œผ๋กœ EC2์—์„œ ๋น„ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋น„๋ฐ€๋ฒˆํ˜ธ ๋กœ๊ทธ์ธ์„ ํ™œ์„ฑํ™”ํ•˜๋ ค๋ฉด SSH ์„ค์ • ํŒŒ์ผ์„ ์ˆ˜์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

 

1. SSH ์„ค์ • ํŒŒ์ผ ์ˆ˜์ •:

sudo vi /etc/ssh/sshd_config

 

2. sshd_config ํŒŒ์ผ์—์„œ ๋‹ค์Œ ํ•ญ๋ชฉ์„ ํ™•์ธํ•˜๊ณ , ํ•„์š”์‹œ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.

PasswordAuthentication yes

 

3. SSH ๋ฐ๋ชฌ ์žฌ์‹œ์ž‘

sudo systemctl restart sshd

 


 

์žฌ๋ฐŒ๋Š” ์˜ค๋Š˜์˜ ๋ ๋ณ„ ์šด์„ธ ๋ณด๊ณ  ๊ฐ€์„ธ์š”! 

 

 

https://cometruedream.tistory.com/247

 

[React] Tailwind ํ•œ์ค„, ๋‘์ค„, ์„ธ์ค„ ํšจ๊ณผ className ์ปค์Šคํ…€

๐Ÿคท‍โ™‚๏ธ Tailwind ํ•œ์ค„, ๋‘์ค„, ์„ธ์ค„ ํšจ๊ณผํ”„๋กœ์ ํŠธ ์ง„ํ–‰์ค‘ ๋ฐฐ๋„ˆ ๋งํฌ์— URL ๊ธธ์ด๊ฐ€ ๋„ˆ๋ฌด ๊ธธ์–ด์„œ 3์ค„ ํšจ๊ณผ ์ฒ˜๋ฆฌ๋ฅผ ํ•ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค. React + Tailwind CSS ์…‹ํŒ…๋œ ํ”„๋กœ์ ํŠธ ์—ฌ์„œ CSS ํŒŒ์ผ & style ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/243

 

NestJS Lifecycle (์ƒ๋ช…์ฃผ๊ธฐ) ๊ฐœ๋…

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œ Nest JS ๊ฐœ๋…?Nest JS๋Š” Node JS ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ ์„œ๋ฒ„ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ํ”„๋ ˆ์ž„์›Œํฌ ์ž…๋‹ˆ๋‹ค. ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋Š” ์ƒ๋‹นํžˆ ์˜ค๋žซ๋™์•ˆ Express ๊ธฐ๋ฐ˜์œผ๋กœ ์„œ๋ฒ„ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ฐœ๋ฐœ์—์„œ ์••๋„์ ์ธ ์ 

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/242

 

๋ฆฌ์•กํŠธ Vite Proxy ํ™œ์šฉํ•œ CORS ์˜ค๋ฅ˜ ํ•ด๊ฒฐ

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œํ”„๋ก ํŠธ์—”๋“œ ๋ฒˆ๋“ค๋Ÿฌ ๊ฐœ๋…๊ณผ webpack vs vite ๋น„๊ต์— ๋Œ€ํ•ด์„œ ๊ณต๋ถ€๋ฅผ ํ•˜๊ณ  ๊ธ€์„ ๋ณด์‹œ๋ฉด ๋” ๋งŽ์€ ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค^^ํ”„๋ก ํŠธ์—”๋“œ ๊ฐœ๋ฐœ์„ ์œ„ํ•œ ๋ฒˆ๋“ค๋Ÿฌ ๊ฐœ๋…๊ณผ webpack vs vite ๋น„๊ตhttps://comet

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/241

 

React ํด๋”๊ตฌ์กฐ FSD ๊ธฐ๋Šฅ ๋ถ„ํ™œ ์„ค๊ณ„ ์•„ํ‚คํ…์ฒ˜

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œํ”„๋กœ์ ํŠธ๋ฅผ ์‹œ์ž‘ํ•˜๊ธฐ์— ์•ž์„œ ํด๋” ๊ตฌ์กฐ, ์„ค๊ณ„์— ๋Œ€ํ•œ ์•„ํ‚คํ…์ฒ˜๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ์€ ์ƒ๋‹นํžˆ ์–ด๋ ต๋‹ค. ์ด๋ฒˆ ํ”„๋กœ์ ํŠธ์— React FSD ํด๋”๊ตฌ์กฐ ์•„ํ‚คํ…์ฒ˜๋ฅผ ์„ค๊ณ„ํ•  ์˜ˆ์ •์ด๋ผ์„œ FSD ์•„ํ‚คํ…

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/244

 

์‰ฝ๊ฒŒ ์ดํ•ดํ•˜๊ณ  ์‚ฌ์šฉํ• ์ˆ˜ ์žˆ๋Š” Prisma ๋ช…๋ น์–ด ์ •๋ฆฌ

๐Ÿคท‍โ™‚๏ธ Prisma ๋ช…๋ น์–ด ๋ณธ๋ก ์— ์•ž์„œ Prisma๋ž€?Nest JS ํ”„๋ ˆ์ž„์›Œํฌ์™€ Prisma ORM์„ ํ™œ์šฉํ•ด์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด์„œ Prisma๋Š” Node JS ๊ธฐ๋ฐ˜์— ํ”„๋ ˆ์ž„์›Œํฌ/๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ์ƒํ˜ธ์ž‘์šฉ์ด ์ž˜๋˜๋ฉฐ Prisma + DB ์—ฐ๋™์œผ

cometruedream.tistory.com

 

 

https://itibiza.tistory.com/entry/%EB%8F%84%EC%BB%A4-%EC%9E%85%EB%AC%B8-%EC%8B%9C%EB%A6%AC%EC%A6%88-Dockerfile-%EA%B0%9C%EB%85%90-%EB%B0%8F-%EC%82%AC%EC%9A%A9%EB%B2%95

 

[๋„์ปค ์ž…๋ฌธ ์‹œ๋ฆฌ์ฆˆ] Dockerfile ๊ฐœ๋… ๋ฐ ์‚ฌ์šฉ๋ฒ•

์ด ๊ธ€์—์„œ๋Š” ์ž…๋ฌธ์ž๋ฅผ ์œ„ํ•œ ๋„์ปค ์‹œ๋ฆฌ์ฆˆ๋กœ ๋„์ปค ์ž…๋ฌธ ์‹œ๋ฆฌ์ฆˆ - Dockerfile ๊ฐœ๋… ๋ฐ ์‚ฌ์šฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค. ์•ˆ๋…•ํ•˜์„ธ์š”! ITibiza ์ž…๋‹ˆ๋‹ค. ์ด์ „ ๊ธ€์—์„œ ๋„์ปค ์ด๋ฏธ์ง€, ์ปจํ…Œ์ด๋„ˆ์˜ ๊ฐœ๋…๊ณผ ๋„์ปค

itibiza.tistory.com