はじめに
公式repositoryを利用してUbuntu 18.04にNginx stable最新版をインストール
親記事:Nginxの各種インストール方法とEOLまとめ
参考:nginx: Linux packages
サポート
本手法で導入した場合、nginxの開発が停止するまでサポートされると思われる。
特定のバージョンを指定しなければ、stable最新版が常に提供されると思われる。
LOG
レポジトリ登録
# apt update; apt install -y curl gnupg2 ca-certificates lsb-release
# echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" | tee /etc/apt/sources.list.d/nginx.list
# curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add -
# apt-key fingerprint ABF5BD827BD9BF62
pub rsa2048 2011-08-19 [SC] [expires: 2024-06-14]
573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62
uid [ unknown] nginx signing key <signing-key@nginx.com>
インストール
# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
# apt update; apt install -y nginx
... 略
各種確認
# which nginx
/usr/sbin/nginx
# nginx -v
nginx version: nginx/1.16.1
# apt show nginx
Package: nginx
Version: 1.16.1-1~bionic
Priority: optional
Section: httpd
Maintainer: Sergey Budnevitch <sb@nginx.com>
Installed-Size: 2995 kB
Provides: httpd
Depends: libc6 (>= 2.27), libpcre3, libssl1.1 (>= 1.1.1), zlib1g (>= 1:1.1.4), lsb-base (>= 3.0-6), adduser
Conflicts: nginx-common, nginx-core
Replaces: nginx-common, nginx-core
Homepage: http://nginx.org
Download-Size: 851 kB
APT-Manual-Installed: yes
APT-Sources: http://nginx.org/packages/ubuntu bionic/nginx amd64 Packages
Description: high performance web server
nginx [engine x] is an HTTP and reverse proxy server, as well as
a mail proxy server.
N: There are 6 additional records. Please use the '-a' switch to see them.