본문 바로가기

퍼블릭 클라우드

[draft] Amazon Linux에 NGINX를 최신 버전으로 설치하는 방법

Amazon Linux에 NGINX를 최신 버전(안정 버전)으로 설치하는 방법

테스트 환경

운영체제 버전

$ cat /etc/os-release | egrep "PRETTY_NAME"
PRETTY_NAME="Amazon Linux 2023"

nginx 버전 정보

$ nginx -v
nginx version: nginx/1.24.0

필수 구성 요소 설치

sudo yum install yum-utils

nginx.repo 파일 생성

cat <<'EOF' > /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/amzn/2023/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
priority=9

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/amzn/2023/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
priority=9
EOF

nginx-stable 활성화

sudo yum-config-manager --enable nginx-stable

nginx 설치

sudo yum install -y nginx
$ sudo yum install -y nginx
...
----------------------------------------------------------------------

Thanks for using nginx!

Please find the official documentation for nginx here:
* https://nginx.org/en/docs/

Please subscribe to nginx-announce mailing list to get
the most important news about nginx:
* https://nginx.org/en/support.html

Commercial subscriptions for nginx are available on:
* https://nginx.com/products/

----------------------------------------------------------------------

  Verifying        : nginx-1.24.0-1.amzn2023.ngx.x86_64                                                                                       1/1

Installed:
  nginx-1.24.0-1.amzn2023.ngx.x86_64

Complete!

 

참고URL

- http://nginx.org/en/linux_packages.html#Amazon-Linux