Linux

[Nginx] Amazon Linux 2에 nginx 설치

nineDeveloper 2021. 1. 1.
728x90

Amazon Linux 2에서는 yum을 통한 nginx 설치가 지원되지 않음

$ sudo yum install nginx
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                                                                                                                                                                                           | 3.7 kB  00:00:00
amzn2extra-docker                                                                                                                                                                                                                                                    | 3.0 kB  00:00:00
No package nginx available.
Error: Nothing to do


nginx is available in Amazon Linux Extra topic "nginx1"

To use, run
# sudo amazon-linux-extras install nginx1

Learn more at
https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras

amazon-linux-extras list 명령어를 통해 설치할 nginx 찾아보기

$ amazon-linux-extras list | grep nginx
38  nginx1=latest            enabled      [ =stable ]

nginx 설치

$ sudo amazon-linux-extras install -y nginx1

nginx 설치 확인

$ nginx -v
nginx version: nginx/1.18.0

nginx 서비스 시작

$ sudo service nginx start
Redirecting to /bin/systemctl start nginx.service
728x90

댓글

💲 추천 글