LoginSignup
0
0

nginxのインストール方法

Last updated at Posted at 2024-02-03

nginxのインストール方法

備忘録であり、リンク先の資料のほうがわかりやすいし、丁寧。

環境

  • ubuntu22.04

nginx

流れ

Step1: 依存パッケージをインストール
Step2: GPG keyを追加
Stpe3: source.listを追加
Stpe4: apt update
Step5: apt install

Step1: 依存パッケージをインストール

sudo apt update
sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring -y

Step2: GPG keyを追加

curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
    | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null

確認:

gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg

Stpe3: source.listを追加

echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
    | sudo tee /etc/apt/sources.list.d/nginx.list

Stpe4: apt update

sudo apt update

Step5: apt install

sudo apt install nginx -y
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0