CentOS 8에 Nginx 1.14 설치(AppStream)

CentOS 8에 Nginx 1.14 설치(AppStream)

2022-10-05 last update

7 minutes reading centos8 appstream nginx

소개



Application Stream (AppStream)을 사용하여 CentOS8에 Nginx1.14 설치
상위 기사 : Nginx의 다양한 설치 방법과 EOL 요약
참고 : RHEL8 패키지 구성 - BaseOS 및 Application Stream - 적모 엔지니어 블로그

지원



본 방법으로 도입한 경우, Red Hat Enterprise Linux 8 Application Streams Life Cycle - Red Hat Customer Portal 보다, 2021-05가 EOL이라고 생각된다.
그 이후에 보고된 취약성이나 결함에 대한 대응은 실시되지 않을 가능성이 있다.

LOG



설치


# cat /etc/redhat-release
CentOS Linux release 8.0.1905 (Core)

# yum install -y @nginx:1.14
... 略

nginx 시작/중지


# systemctl start nginx
# systemctl status -l nginx
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/nginx.service.d
           mqphp-fpm.conf
   Active: active (running) since Thu 2019-09-26 06:35:24 EDT; 1min 5s ago
  Process: 7819 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 7817 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 7815 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 7820 (nginx)
    Tasks: 3 (limit: 11109)
   Memory: 7.0M
   CGroup: /system.slice/nginx.service
           tq7820 nginx: master process /usr/sbin/nginx
           tq7821 nginx: worker process
           mq7822 nginx: worker process

Sep 26 06:35:24 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...
Sep 26 06:35:24 localhost.localdomain nginx[7817]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Sep 26 06:35:24 localhost.localdomain nginx[7817]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Sep 26 06:35:24 localhost.localdomain systemd[1]: Started The nginx HTTP and reverse proxy server.
# systemctl stop nginx
# systemctl status -l nginx
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/nginx.service.d
           mqphp-fpm.conf
   Active: inactive (dead)

Sep 26 06:33:48 localhost.localdomain systemd[1]: Started The nginx HTTP and reverse proxy server.
Sep 26 06:33:50 localhost.localdomain systemd[1]: Stopping The nginx HTTP and reverse proxy server...
Sep 26 06:33:50 localhost.localdomain systemd[1]: Stopped The nginx HTTP and reverse proxy server.
Sep 26 06:34:59 localhost.localdomain systemd[1]: nginx.service: Unit cannot be reloaded because it is inactive.
Sep 26 06:35:24 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...
Sep 26 06:35:24 localhost.localdomain nginx[7817]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Sep 26 06:35:24 localhost.localdomain nginx[7817]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Sep 26 06:35:24 localhost.localdomain systemd[1]: Started The nginx HTTP and reverse proxy server.
Sep 26 06:36:54 localhost.localdomain systemd[1]: Stopping The nginx HTTP and reverse proxy server...
Sep 26 06:36:54 localhost.localdomain systemd[1]: Stopped The nginx HTTP and reverse proxy server.

nginx 자동 시작 설정/설정 해제


# systemctl enable nginx
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.

# systemctl list-unit-files --type=service |grep nginx
nginx.service                               enabled
# systemctl disable nginx
Removed /etc/systemd/system/multi-user.target.wants/nginx.service.

# systemctl list-unit-files --type=service |grep nginx
nginx.service                               disabled

각종 확인


# which nginx
/usr/sbin/nginx

# nginx -v
nginx version: nginx/1.14.1

# yum module info @nginx:1.14
Last metadata expiration check: 0:44:15 ago on Thu 26 Sep 2019 05:58:05 AM EDT.
Unable to resolve argument @nginx:1.14
Error: No matching Modules to list
[[email protected] ~]# yum module info nginx:1.14
Last metadata expiration check: 0:44:20 ago on Thu 26 Sep 2019 05:58:05 AM EDT.
Name             : nginx
Stream           : 1.14 [d][e][a]
Version          : 8000020190628020724
Context          : 55190bc5
Profiles         : common [d] [i]
Default profiles : common
Repo             : AppStream
Summary          : nginx webserver
Description      : nginx 1.14 webserver module
Artifacts        : nginx-1:1.14.1-8.module_el8.0.0+5+258f653c.src
                 : nginx-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
                 : nginx-all-modules-1:1.14.1-8.module_el8.0.0+5+258f653c.noarch
                 : nginx-debuginfo-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
                 : nginx-debugsource-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
                 : nginx-filesystem-1:1.14.1-8.module_el8.0.0+5+258f653c.noarch
                 : nginx-mod-http-image-filter-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
                 : nginx-mod-http-image-filter-debuginfo-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
                 : nginx-mod-http-perl-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
                 : nginx-mod-http-perl-debuginfo-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
                 : nginx-mod-http-xslt-filter-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
                 : nginx-mod-http-xslt-filter-debuginfo-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
                 : nginx-mod-mail-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
                 : nginx-mod-mail-debuginfo-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
                 : nginx-mod-stream-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
                 : nginx-mod-stream-debuginfo-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled, [a]ctive]