nginx
2024년 4월 13일

우분투 20.04 에서 Nginx 를 설치하는 방법

ubuntuubuntu 20.04nginx

Nginx 는 가장 인기 있는 웹 서버 중에 하나 입니다. 2021년 기준으로 Apache 를 제치고, HTTP/HTTPS 서버 점유율 1위를 하였습니다. 웹 서버나 역방향 프록시(reverse proxy) 서비스를 하는 경우 우선적으로 고려해 볼 수 있습니다.

nginx 설치

Nginx 는 우분투에서 제공하는 패키지 관리자를 통해 설치할 수 있습니다. 패키지 목록을 최신 버전으로 갱신하기 위해 update 명령을 실행합니다. install 명령으로 nginx 를 설치합니다.

$ sudo apt update
$ sudo apt install nginx

웹 서버 확인

설치가 끝나면 자동으로 nginx 서버를 시작합니다. systemd 관련 명령으로 서비스가 동작하고 있는지 확인할 수 있습니다.

$ systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2024-04-12 09:33:22 UTC; 1 day 2h ago
       Docs: man:nginx(8)
   Main PID: 18483 (nginx)
      Tasks: 3 (limit: 9447)
     Memory: 8.8M
     CGroup: /system.slice/nginx.service
             ├─18483 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
             ├─18484 nginx: worker process
             └─18485 nginx: worker process

Warning: journal has been rotated since unit was started, output may be incomplete.
© 2023-2024 인포그라. All Rights Reserved.