LoginSignup
0
0

More than 1 year has passed since last update.

CentOSにNginxをインストールする

Last updated at Posted at 2021-07-18

CentOSにNginxをインストールしたので、覚え書き

環境

  • OS: CentOS 7.9.2009 (GCP: Compute Engine)
  • Nginx: 1.20.1(2021年7月18日現在、Stable)

手順

(1) 以下のコマンドを実行

$ vi /etc/yum.repos.d/nginx.repo

(2) インサートモードに切り替えて、以下を貼り付けし、保存

[nginx]
name=nginx repo
baseurl=https://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

(3) システムパッケージを更新

$ sudo yum update

(4) Nginxをインストール

$ sudo yum install -y nginx

(5) 完了したら(Complete!と表示されたら)、インストールされたこと&バージョン確認しておく

$ nginx -v

メモ

参考欄に記載のリンク先の内容実施後(手順の(1), (2))、yum update&yum installが必要。

参考

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