์ƒˆ์†Œ์‹

Cloud/AWS

[EC2] AWS EC2 ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ ํ›„ ์ตœ์ดˆ ์„ค์ •

  • -

 

 

 

 

AWS EC2 ์ธ์Šคํ„ด์Šค๋ฅผ ์ตœ์ดˆ ์ƒ์„ฑํ•œ ํ›„์— ํ•„์ˆ˜/์„ ํƒ์ ์œผ๋กœ ์„ค์ •ํ•˜๋ฉด ์ข‹์„๋งŒํ•œ ๊ฒƒ๋“ค์„ ๊ธฐ๋ก ๋ชฉ์ ์œผ๋กœ ์ž‘์„ฑํ•ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

์ž์ฃผ ์žƒ์–ด๋ฒ„๋ฆฌ๊ณ  ์ฐพ๋Š” ์‹œ๊ฐ„์„ ์ค„์ด๊ธฐ ์œ„ํ•ด ์ž‘์„ฑ๋˜์—ˆ์œผ๋‹ˆ ์ž˜๋ชป๋œ ์ ์ด ์žˆ๋‹ค๋ฉด ๋Œ“๊ธ€๋กœ ์•Œ๋ ค์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

 


 

#1. ์ตœ์‹ ๋ฒ„์ „์œผ๋กœ ์—…๋ฐ์ดํŠธ

$ sudo yum update

 

#2. yum-cron ํŒจํ‚ค์ง€

์•„๋ž˜์˜ ๋งํฌ์—์„œ ํ™•์ธํ•ด์ฃผ์„ธ์š”.

 

[Linux] yum-cron ์ž๋™ ์—…๋ฐ์ดํŠธ ์„ค์น˜ ๋ฐ ๊ตฌ์„ฑ

์ •๊ธฐ์ ์œผ๋กœ ์—…๋ฐ์ดํŠธ ์ „๋ฐ˜์ ์ธ ์‹œ์Šคํ…œ ๋ณด์•ˆ์—์„œ ๊ฐ€์žฅ ์ค‘์š”ํ•œ ์ธก๋ฉด ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค. ์šด์˜ ์ฒด์ œ์˜ ํŒจํ‚ค์ง€๋ฅผ ์ตœ์‹  ๋ณด์•ˆ ํŒจ์น˜๋กœ ์—…๋ฐ์ดํŠธํ•˜์ง€ ์•Š์œผ๋ฉด ์‹œ์Šคํ…œ์ด ๊ณต๊ฒฉ์— ์ทจ์•ฝํ•ด์ง‘๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ ์ž๋™ ์—…

sm-code.tistory.com

 

#3. EPEL ํŒจํ‚ค์ง€

EPEL(Extra Packages for Enterprise Linux)๋ž€ ๋น„์ฆˆ๋‹ˆ์Šค ํ™˜๊ฒฝ์„ ์œ„ํ•œ ๋ฐฐํฌ์šฉ ๊ณ ํ’ˆ์งˆ ํŒจํ‚ค์ง€์ด๋ฉฐ, ์ƒ์„ฑ, ์œ ์ง€, ๊ด€๋ฆฌํ•˜๋Š” Fedora ๊ฐœ๋ฐœ์ž ์ปค๋ฎค๋‹ˆํ‹ฐ ๊ทธ๋ฃน์— ์˜ํ•ด์„œ ๊ฐœ๋ฐœ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๊ธฐ๋ณธ ์ €์žฅ์†Œ์— ์—†๋Š” ๋งŽ์ด ํŒจํ‚ค์ง€๋“ค์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค.

$ sudo amazon-linux-extras install epel

 

 

#4. ๋ช…๋ นํ”„๋กฌํ”„ํŠธ ์ปค์Šคํ…€

๋ฆฌ๋ˆ…์Šค ๊ธฐ๋ณธ ๋ช…๋ นํ”„๋กฌํ”„ํŠธ๋Š” ๊ฐœ์ธ์ ์œผ๋กœ ์กฐ๊ธˆ ํˆฌ๋ฐ•ํ•˜๊ณ  ์žฌ๋ฏธ(?)์—†์–ด ๋ณด์ž…๋‹ˆ๋‹ค. ํŠน์ • ํ”„๋กœ๊ทธ๋žจ ํˆด์„ ์ด์šฉํ•˜๋ฉด ํ•˜์ด๋ผ์ดํŒ…์ด ์ž˜๋˜๊ธฐ๋„ ํ•˜์ง€๋งŒ, ์•„๋ž˜์™€ ๊ฐ™์ด ๊ฐ€๋…์„ฑ ์—…๋ฐ์ดํŠธ๋ฅผ ์ง„ํ–‰ํ•ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

 

#4. 1. ์‚ฌ์šฉ์ž๋ช…@์ธ์Šคํ„ด์Šค์ด๋ฆ„ [ ํ’€ ๊ฒฝ๋กœ ]

$ sudo vi /etc/bashrc
#๋…ธ๋ž‘์ƒ‰
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="\[\e[36;1m\]\u@\[\e[33;1m\]aws-ec2-instance\[\e[31;1m\] [ \w ] \[\e[0m\]"

#์ดˆ๋ก์ƒ‰
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="\[\e[36;1m\]\u@\[\e[32;1m\]aws-ec2-instance\[\e[31;1m\] [ \w ] \[\e[0m\]"

์ €์žฅ ํ›„ ์žฌ์ ‘์†ํ•˜๋ฉด ์ ์šฉ ์™„๋ฃŒ

 

 

#5. ํƒ€์ž„์กด ์„ค์ •

 

#5. 1. ํ˜„์žฌ ํƒ€์ž„์กด ํ™•์ธ

$ timedatectl

 

#5. 2. ํƒ€์ž„์กด ๋ชฉ๋ก ์กฐํšŒ

$ timedatectl list-timezones | grep Seoul
Asis/Seoul

 

#6. ๋กœ์ผ€์ผ ์„ค์ •

 

#6. 1. ๋ณ€๊ฒฝ ์ „ ํ™•์ธ

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

 

#6. 2. ๋ณ€๊ฒฝ ์ง„ํ–‰

$ sudo vi /etc/locale.conf
#LANG=en_US.UTF-8
LANG=ko_KR.UTF-8

 

#6. 3. ๋ณ€๊ฒฝ ์™„๋ฃŒ ํ™•์ธ

locale
LANG=ko_KR.UTF-8
LC_CTYPE="ko_KR.UTF-8"
LC_NUMERIC="ko_KR.UTF-8"
LC_TIME="ko_KR.UTF-8"
LC_COLLATE="ko_KR.UTF-8"
LC_MONETARY="ko_KR.UTF-8"
LC_MESSAGES="ko_KR.UTF-8"
LC_PAPER="ko_KR.UTF-8"
LC_NAME="ko_KR.UTF-8"
LC_ADDRESS="ko_KR.UTF-8"
LC_TELEPHONE="ko_KR.UTF-8"
LC_MEASUREMENT="ko_KR.UTF-8"
LC_IDENTIFICATION="ko_KR.UTF-8"
LC_ALL=

 

#7. Amazon Corretto 11 (Java)

$ sudo yum install java-11-amazon-corretto-headless

 

#7. 1. ๋ฒ„์ „ ํ™•์ธ (1)

$ java -version
openjdk version "11.0.17" 2022-10-18 LTS
OpenJDK Runtime Environment Corretto-11.0.17.8.1 (build 11.0.17+8-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.17.8.1 (build 11.0.17+8-LTS, mixed mode)

 

#7. 2. ๋ฒ„์ „ ํ™•์ธ (2)

$ java -fullversion
openjdk full version "11.0.17+8-LTS"

 

#8. Nginx

์„ค์น˜ ๋ฐฉ๋ฒ•์€ ์•„๋ž˜์˜ ๋งํฌ๋ฅผ ํ™•์ธํ•ด์ฃผ์„ธ์š”.

 

[Nginx] Amazon Linux 2 ํ™˜๊ฒฝ์—์„œ Nginx ์„ค์น˜ํ•˜๊ธฐ

Nginx ๊ด€๋ จํ•ด์„œ๋Š” ์ด์ „์— ์ž‘์„ฑํ•œ ์ ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค๋งŒ, EC2 ์ธ์Šคํ„ด์Šค๋ฅผ ์ƒ์„ฑํ•˜๊ณ  Amazon Linux 2 ํ™˜๊ฒฝ์—์„œ ์ƒˆ๋กญ๊ฒŒ ์„ธํŒ…์„ ํ•˜๋Š” ๋„์ค‘์— ์„ค์น˜ ๋ฐฉ๋ฒ•์— ์ฐจ์ด๊ฐ€ ์žˆ์–ด์„œ ๊ธฐ๋ก ๋ชฉ์ ์œผ๋กœ ์ž‘์„ฑํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์ž˜๋ชป

sm-code.tistory.com

 

Nginx ์‚ฌ์šฉ ๊ฐ€์ด๋“œ ๊ด€๋ จ ์ •๋ฆฌ (์˜ˆ์ •)

Nginx SSL ๋ฌด๋ฃŒ ์ธ์ฆ์„œ ์„ค์น˜ ๋ฐ ๊ฐฑ์‹  (์˜ˆ์ •)

 

 

#9. Docker (์˜ˆ์ •)

#10. MariaDB (์˜ˆ์ •)

 

 

 

 

 

Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค. ๐Ÿ˜Š

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ๐Ÿ‘