Opensourcetechブログ

OpensourcetechによるNGINX/Kubernetes/Zabbix/Neo4j/Linuxなどオープンソース技術に関するブログです。

NGINX Plusのインストール

こんにちは、LinuCエバンジェリストこと、鯨井貴博@opensourcetechです。

 

今回は nginxの有償版である「NGINX Plus」を使ってみます。

 

 

NGINX Plusとは?

nginxの有償版で、コミニティー版と比較して以下のようなことが可能です。

・Reverse Proxyとして使用時、Backendサーバへのヘルスチェック

・Reverse Proxyとして使用時、Backendサーバへ有償版のみの負荷分散方法

NGINX Plus software load balancer, web server, and cache | NGINX

上記の下部を見ると、コミニティー版との比較表があります。

f:id:opensourcetech:20181121010901p:plain

f:id:opensourcetech:20181121010904p:plain

 

なお、NGINX Plusには30日間のFree Traial版がありますので、

今回はそれを使います。

[Free trial] Download NGINX Plus and NGINX WAF, Get Started in Minutes

f:id:opensourcetech:20181121011119p:plain

 

 

 

NGINX Plus Free Traialの利用

NGINX Plus Free Traialは、以下の必要項目を記入して申し込みます。

[Free trial] Download NGINX Plus and NGINX WAF, Get Started in Minutes

f:id:opensourcetech:20181121011300p:plain

 

申し込みができると、申し込み時に記入したアドレスへメールが届くのを待ちます。

f:id:opensourcetech:20181121011427p:plain

f:id:opensourcetech:20181121011432p:plain

 

申請受け付けたよ、ちょっとだけ待ってってねというメールが来ます。

f:id:opensourcetech:20181121011551p:plain

 

その後、ここからトライアル版を取れますよとメールが送られてきます。

f:id:opensourcetech:20181121111852p:plain

 

メールにあるリンクにアクセスすると、

NGINX Plusをレポジトリからダウンロードするために必要な秘密鍵とクライアント証明書を取得できます。

f:id:opensourcetech:20181121011628p:plain

 

f:id:opensourcetech:20181121011642p:plain

 

取得したファイル。

f:id:opensourcetech:20181121011701p:plain

 

 

 

NGINX Plus のインストール

インストール方法は、以下のサイトで様々なディストリビューション毎に確認でき、基本的にはドキュメント通りに進めれば問題ないかと思います。

Instructions | NGINX

f:id:opensourcetech:20181121011917p:plain

 

使用しているディストリビューションを選択します。

※今回は、CentOS7.5を使っていたので以下を選びました。

 

f:id:opensourcetech:20181121011924p:plain

 

あとは、選択したディストリビューションに合わせた手順が表示されるので、

その通り進めていけばOKです。

f:id:opensourcetech:20181121011930p:plain

f:id:opensourcetech:20181121011932p:plain

 

 

 以下、インストールログです。

[root@localhost ~]# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)
[root@localhost ~]#
[root@localhost ~]# ls /etc/yum.repos.d/
CentOS-Base.repo CentOS-Media.repo CentOS-fasttrack.repo
CentOS-CR.repo CentOS-Sources.repo zabbix.repo
CentOS-Debuginfo.repo CentOS-Vault.repo
[root@localhost ~]# mkdir -p /etc/ssl/nginx


XYZ:Downloads Yoshiki$ scp ./nginx-repo.key root@192.168.11.72:/etc/ssl/nginx/
root@192.168.11.72's password:
nginx-repo.key 100% 1708 73.9KB/s 00:00
XYZ:Downloads Yoshiki$ scp ./nginx-repo.crt root@192.168.11.72:/etc/ssl/nginx/
root@192.168.11.72's password:
nginx-repo.crt 100% 1334 59.1KB/s 00:00

 

[root@localhost ~]# ls /etc/ssl/nginx
nginx-repo.crt nginx-repo.key
[root@localhost ~]# ls -l /etc/ssl/nginx
合計 8
-rw-r--r--. 1 root root 1334 11月 12 19:05 nginx-repo.crt
-rw-r--r--. 1 root root 1708 11月 12 19:05 nginx-repo.key
[root@localhost ~]# yum install ca-certificates
読み込んだプラグイン:fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
12: Timeout on http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock error was
12: Timeout on http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
* base: ftp.riken.jp
* extras: ftp.riken.jp
* updates: ftp.riken.jp
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
zabbix | 2.9 kB 00:00
zabbix-non-supported | 951 B 00:00
(1/3): extras/7/x86_64/primary_db | 205 kB 00:00
(2/3): zabbix/x86_64/primary_db | 19 kB 00:00
(3/3): updates/7/x86_64/primary_db | 6.0 MB 00:01
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ ca-certificates.noarch 0:2017.2.20-71.el7 を 更新
---> パッケージ ca-certificates.noarch 0:2018.2.22-70.0.el7_5 を アップデート
--> 依存性解決を終了しました。

依存性を解決しました

================================================================================
Package アーキテクチャー
バージョン リポジトリー 容量
================================================================================
更新します:
ca-certificates noarch 2018.2.22-70.0.el7_5 updates 392 k

トランザクションの要約
================================================================================
更新 1 パッケージ

総ダウンロード容量: 392 k
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
ca-certificates-2018.2.22-70.0.el7_5.noarch.rpm | 392 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
更新します : ca-certificates-2018.2.22-70.0.el7_5.noarch 1/2
整理中 : ca-certificates-2017.2.20-71.el7.noarch 2/2
検証中 : ca-certificates-2018.2.22-70.0.el7_5.noarch 1/2
検証中 : ca-certificates-2017.2.20-71.el7.noarch 2/2

更新:
ca-certificates.noarch 0:2018.2.22-70.0.el7_5

完了しました!
[root@localhost ~]# rpm -q ca-certificates
ca-certificates-2018.2.22-70.0.el7_5.noarch
[root@localhost ~]# ls /etc/yum.repos.d/
CentOS-Base.repo CentOS-Media.repo CentOS-fasttrack.repo
CentOS-CR.repo CentOS-Sources.repo zabbix.repo
CentOS-Debuginfo.repo CentOS-Vault.repo

[root@localhost ~]# wget -P /etc/yum.repos.d/ https://cs.nginx.com/static/files/nginx-plus-7.4.repo
--2018-11-12 19:11:31-- https://cs.nginx.com/static/files/nginx-plus-7.4.repo
cs.nginx.com (cs.nginx.com) をDNSに問いあわせています... 206.251.255.62
cs.nginx.com (cs.nginx.com)|206.251.255.62|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 200 [application/octet-stream]
`/etc/yum.repos.d/nginx-plus-7.4.repo' に保存中

100%[======================================>] 200 --.-K/s 時間 0s

2018-11-12 19:11:32 (20.6 MB/s) - `/etc/yum.repos.d/nginx-plus-7.4.repo' へ保存完了 [200/200]

[root@localhost ~]# ls /etc/yum.repos.d/
CentOS-Base.repo CentOS-Media.repo CentOS-fasttrack.repo
CentOS-CR.repo CentOS-Sources.repo nginx-plus-7.4.repo ・・・追加ファイル
CentOS-Debuginfo.repo CentOS-Vault.repo zabbix.repo
[root@localhost ~]# cat /etc/yum.repos.d/nginx-plus-7.4.repo
[nginx-plus]
name=nginx-plus repo
baseurl=https://plus-pkgs.nginx.com/centos/7.4/$basearch/
sslclientcert=/etc/ssl/nginx/nginx-repo.crt
sslclientkey=/etc/ssl/nginx/nginx-repo.key
gpgcheck=0
enabled=1
[root@localhost ~]# yum install nginx-plus
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.riken.jp
* extras: ftp.riken.jp
* updates: ftp.riken.jp
nginx-plus | 2.9 kB 00:00
nginx-plus/x86_64/primary_db | 73 kB 00:01
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ nginx-plus.x86_64 0:16-2.el7_4.ngx を インストール
--> 依存性解決を終了しました。

依存性を解決しました

================================================================================
Package アーキテクチャー
バージョン リポジトリー 容量
================================================================================
インストール中:
nginx-plus x86_64 16-2.el7_4.ngx nginx-plus 3.4 M

トランザクションの要約
================================================================================
インストール 1 パッケージ

総ダウンロード容量: 3.4 M
インストール容量: 8.5 M
Is this ok [y/d/N]: y
Downloading packages:
nginx-plus-16-2.el7_4.ngx.x86_64.rpm | 3.4 MB 00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
インストール中 : nginx-plus-16-2.el7_4.ngx.x86_64 1/1
----------------------------------------------------------------------

Thank you for using NGINX!

Please find the documentation for NGINX Plus here:
/usr/share/nginx/html/nginx-modules-reference.pdf

NGINX Plus is proprietary software. EULA and License information:
/usr/share/doc/nginx-plus/

For support information, please see:
https://www.nginx.com/support/

----------------------------------------------------------------------
検証中 : nginx-plus-16-2.el7_4.ngx.x86_64 1/1

インストール:
nginx-plus.x86_64 0:16-2.el7_4.ngx

完了しました!
[root@localhost ~]# rpm -q nginx-plus
nginx-plus-16-2.el7_4.ngx.x86_64
[root@localhost ~]# nginx -v
nginx version: nginx/1.15.2 (nginx-plus-r16-p1)

 

 

 

 

www.slideshare.net

github.com

www.facebook.com

twitter.com

www.instagram.com

 

 

にほんブログ村 IT技術ブログ Linuxへ
Linux

にほんブログ村 IT技術ブログ オープンソースへ
オープンソース

 

 

Opensourcetech by Takahiro Kujirai