LoginSignup
2
1

More than 3 years have passed since last update.

CentOS8 Nginx1.18 インストール on さくらVPS

Posted at

やったこと

  • nginx.repo の作成
  • nginx 安定版(stable)のインストール

参考サイト
https://minokamo.tokyo/2021/03/18/3476/

手順

環境

# cat /etc/redhat-release 
CentOS Linux release 8.3.2011

# vi /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

# sudo dnf install nginx
# nginx -v
nginx version: nginx/1.18.0

以上になります。

最新版を利用する場合

最新版(mainline): nginx-mainline

参考サイトyum-config-manager --enable nginx-mainline が通らない場合は、 nginx-mainline だけ記載すれば出来ます。

yum-config-manager を使うためには、yum-utils が必要になります。
https://akamist.com/blog/archives/942 に書かれておりました。

また、その場合は、
/etc/yum.repos.d/nginx.repo ここではないようなので、ご注意ください
★どこなのかまで、調べてないです・・・

まとめ

しばらくサーバを触っていないと色々古くなっているので、アップデで時間かかりますね。
今後は放置気味をやめていきたいところです。

dnfコマンドに変わりましたが、yum で通るのでどちらでも大丈夫ですね。

2
1
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
2
1