LoginSignup
0
0

More than 3 years have passed since last update.

CentOS 6にNginx mainline最新版をインストール(公式repository)

Posted at

はじめに

公式repositoryを利用してCentOS6にNginx mainline最新版をインストール
親記事:Nginxの各種インストール方法とEOLまとめ
参考:nginx: Linux packages

サポート

本手法で導入した場合、nginxの開発が停止するまでサポートされると思われる。
特定のバージョンを指定しなければ、mainline最新版が常に提供されると思われる。

LOG

レポジトリ登録

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

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

インストール

# cat /etc/redhat-release
CentOS release 6.10 (Final)

# yum install -y nginx
... 略

nginx起動/停止

# service nginx start
Starting nginx:                                            [  OK  ]

# service nginx status
nginx (pid 107) is running...
# service nginx stop
Stopping nginx:                                            [  OK  ]

# service nginx status
nginx is stopped

nginx自動起動設定/設定解除

# chkconfig nginx on

# chkconfig --list nginx
nginx           0:off   1:off   2:on    3:on    4:on    5:on    6:off
# chkconfig nginx off

# chkconfig --list nginx
nginx           0:off   1:off   2:off   3:off   4:off   5:off   6:off

各種確認

# which nginx
/usr/sbin/nginx

# nginx -v
nginx version: nginx/1.17.4

# yum info nginx
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
 * base: mirror.fairway.ne.jp
 * extras: mirror.fairway.ne.jp
 * updates: mirror.fairway.ne.jp
Installed Packages
Name        : nginx
Arch        : x86_64
Version     : 1.17.4
Release     : 1.el6.ngx
Size        : 2.6 M
Repo        : installed
From repo   : nginx-mainline
Summary     : High performance web server
URL         : http://nginx.org/
License     : 2-clause BSD-like license
Description : nginx [engine x] is an HTTP and reverse proxy server, as well as
            : a mail proxy server.
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