Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

...

Nginx 설치

Yum

...

으로 설치

sudo yum install nginx -y

...

AWS:

...

sudo yum install https://nginx.org/packages/mainline/centos/7/x86_64/RPMS/nginx-1.19.2-1.el7.ngx.x86_64.rpm -y

  • released date: 11/08/2020

Option3. Binary Install

...

sudo amazon-linux-extras install nginx1.12

[폐쇠망추천] Binary Install

nginx rpm 파일 다운로드

(예시) centos 7

https://nginx.org/packages/mainline/centos/7/x86_64/RPMS/nginx-1.19.2-1.el7.ngx.x86_64.rpm

...

FTP로 서버에 파일 전송

...

Install using yum

sudo yum install localinstall /home/ec2-user/ginxnginx-1.19.2-1.el7.ngx.x86_64.rpm -y

AWS

sudo amazon-linux-extras install nginx1.12

Docker

Pull & Run container

docker run --name nginx -p 80:80 -d nginx

 

Image Pull

docker pull nginx:latest

  • required install docker

 

Reference: 

Start Nginx

Start Nginx on Linux

Nginx does not start on its own. To get Nginx running, type:

sudo systemctl start nginx

Start Nginx docker container

Code Block
docker run --restart="always" -d --name nginx \
-p 80:80 -p 443:443 \
-v /etc/nginx/nginx.conf:/etc/nginx/nginx.conf \
-v /var/log/nginx:/var/log/nginx \
-v /etc/nginx/conf.d/:/etc/nginx/conf.d/ \
nginx:latest
  • -v /etc/nginx/nginx.conf:/etc/nginx/nginx.conf : synchronise with actual nginx.conf path

  • -v /var/log/nginx:/var/log/nginx/ : synchronise with actual nginx log path

  • -v /etc/nginx/conf.d/:/etc/nginx/conf.d/ : synchronise with actual conf.d folder path to set sub domain

Restart

sudo systemctl restart nginx

Background Start Nginx when your system boots

Before continuing, you will probably want to enable Nginx to start when your system boots. To do so, enter the following command:

sudo systemctl enable nginx