Linuxのcentos7 1.61.1にバージョン1.12.2からスムーズなアップグレードのnginxのyumをインストールしたバージョンを実装

nginxの-1.16.1にyumをnginxの-1.12.2のインストール

まず、既存のnginxのコンパイル済みのパラメータを確認
[ルート@は、VM-3〜]#-V nginxの
nginxの/ 1.12.2:nginxのバージョン
のgcc 4.8.5によって建て20150623(Red Hatの4.8.5-36)(GCC)
で構築されました26月1.0.2kは、OpenSSL 2017 FIPS
TLS SNIサポートが有効
のconfigureの引数:--prefix =を/ usr / share / nginxの--sbinパス=は/ usr / sbinに/ nginxの--modulesパス= / USR / lib64に/ nginxの/モジュール--confパス=の/ etc / nginxの/ nginx.conf --error-ログパス=は/ var / log / nginxの/ error.logファイル--http-ログパス=は/ var / log / nginxの/ access.logを--http-クライアント・ボディTEMPパス=の/ var / LIB / nginxの/ TMP / clientbody --httpプロキシ-TEMPパス= / VAR / LIB / nginxの/ TMP /プロキシ--http-のFastCGI-TEMPパス= / VAR / LIB / nginxの/ TMP / FastCGIの - HTTP-uwsgi-TEMPパス=の/ var / libに/ nginxのを/ tmp / uwsgi --http-SCGI-TEMPパス=の/ var / libに/ nginxのを/ tmp / SCGI --pid-パス= /実行/ nginxの。PID --lock-パス= /実行/ロック/ SUBSYS / nginxの--user = nginxの--group = nginxの--with-FILE-AIO --with-IPv6の--with-httpauthrequestmodule --with-httpsslmodule --with -httpv2module --with-httprealipmodule --with-httpadditionmodule --with-httpxsltmodule = --with-httpimagefiltermodule =動的--with-httpgeoipmodule =動的--with-httpsubmodule --with-httpdavmodule --with-httpflvmodule動的 - --with-httpgunzipmodule --with-httpgzipstaticmodule --with-httprandomindexmodule --with-httpsecurelinkmodule --with-httpdegradationmodule --with-httpslicemodule --with-httpstubstatusmodule --with-httpperlmodule =動的--withメール-httpmp4moduleと=動的--with-mailsslmodule --with-PCRE --with-PCRE-JIT --withストリーム=動的--with-streamsslmodule --with-googleperftoolsmodule --withデバッグ--with-httprandomindexmodule --with-httpsecurelinkmodule --with-httpdegradationmodule --with-httpslicemodule --with-httpstubstatusmodule --with-httpperlmodule = --with-PCRE --with-mailsslmodule --withメール=動的動的 - -with-PCRE-JIT --withストリーム=動的--with-streamsslmodule --with-googleperftoolsmodule --withデバッグ--with-httprandomindexmodule --with-httpsecurelinkmodule --with-httpdegradationmodule --with-httpslicemodule --with-httpstubstatusmodule --with-httpperlmodule = --with-PCRE --with-mailsslmodule --withメール=動的動的 - -with-PCRE-JIT --withストリーム=動的--with-streamsslmodule --with-googleperftoolsmodule --withデバッグ --with-CC-OPT = ' - O2 -g -pipe -Wall -Wp、-D_FORTIFY_SOURCE = 2 -fexceptions -fstackプロテクター強い--param = SSP-バッファサイズ= 4 -grecord-GCC-スイッチ - スペック=は/ usr / libに/回転数/ redhatの/ redhatの硬化-CC1 -m64 -mtune =一般的な '--with-LD-OPT =' - W1を、-z、relro -specs =は/ usr / libに/回転数/ redhatの/ redhatの硬化-LDの-Wl、-E」

第二に、コンフィギュレーションは、コンフィギュレーションを必要としない、あなただけのmake installをしていない、ようにする必要があり、バックシステム構成ファイルに上記の太字、太字フォントの一部となります。メイクは元の設定ファイルをカバーしますインストールした場合

これらの依存関係は、第一のウェルを進めることができ、次のエラーが設定した後に発生しません
yumをインストール-yのGeoIPのGeoIP-develののGeoIP -データのperl-develのperlの-のExtUtils-埋め込みGD-のdevelのlibxml2のlibxsltの-develのは、PCRE-develのをgperftools opensslのopenssl-develの
usrr /ローカル/下/上のnginxの新しいバージョンを用意

[ルート@のVM-3]#wgetのhttp://nginx.org/download/nginx-1.16.1.tar.gz
[ルート@のVM-3]#タール-xfのnginx-1.16.1.tar.gz
[ルート@ VM-3]#のCDのnginxの-1.16.1
[ルート@ VM-3のnginx-1.16.1]#は./configure --prefix =を/ usr / share / nginxの--sbinパス=は/ usr / sbinに/ nginxの--modulesパス= / USR / lib64に/ nginxの/モジュール--confパス=の/ etc / nginxの/ nginx.conf --errorログパス=は/ var / log / nginxの/ error.logファイル--httpログパス=は/ var / log / nginxの/アクセス.logの--http-クライアント・ボディTEMPパス=の/ var / libに/ nginxのを/ tmp / client_body --http-プロキシTEMPパス=の/ var / libに/ nginxのを/ tmp /プロキシ--http-fastcgi- TEMPパス= / VAR / LIB / nginxの/ TMP / FastCGIの--http-uwsgi-TEMPパス= / VAR / LIB / nginxの/ TMP / uwsgi --http-SCGI-TEMPパス= / VAR / LIB / nginxの/ tmp / SCGI --pid-パス= /実行/ nginxの。PID --lock-パス= /実行/ロック/ SUBSYS / nginxの--user = nginxの--group = nginxの--with-FILE-AIO --with-IPv6の--with-http_auth_request_module --with-http_ssl_module --with -http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module = --with-http_image_filter_module =動的--with-http_geoip_module =動的--with-http_sub_module --with-http_dav_module --with-http_flv_module動的 - --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module =動的--withメール-http_mp4_moduleと=動的--with-mail_ssl_module --with-PCRE --with-PCRE-JIT --withストリーム=動的--with-stream_ssl_module --with-google_perftools_module --withデバッグ--with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module =動的--withメール=動的--with-mail_ssl_module --with-PCRE --with-PCRE-JIT --withストリーム=動的--with-stream_ssl_module --with-google_perftools_module - で、デバッグ--with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module =動的--withメール=動的--with-mail_ssl_module --with-PCRE --with-PCRE-JIT --withストリーム=動的--with-stream_ssl_module --with-google_perftools_module - で、デバッグ--with-stream_ssl_module --with-デバッグgoogle_perftools_module --with--with-stream_ssl_module --with-デバッグgoogle_perftools_module --with

可能性のあるエラーの
エラー1:
./configureを:エラー:HTTP XSLTモジュール]は、libxml2のに必要となるで/ libxsltは
あなたのいずれかによってライブラリモジュールでライブラリを有効にするか、または...でインストールしないで行うことができます
理由:信頼の欠如
解決する:
[ルート@のVM-3のnginx -1.16.1]#yumを-yインストールのlibxml2 libxsltは -devel

コンフィギュレーションは、再び
:2与えられて
は./configure:エラー:フィルタModule1のザ・はHTTPイメージライブラリザ・GDが必要です。
あなたのいずれかによっては、ライブラリザ・Module1]をインストールし有効にすることはできませんかん。
解像度:インストールが依存
yumのは、-y GD-develのインストール

配置再次
报错3:
./configureをエラー:PerlのモジュールのExtUtils ::埋め込みが必要とされる
解决:
YUM -yインストールのperl-develのperlの-のExtUtils-埋め込み
再次配置
报错4:
./configureをエラー:のGeoIPモジュールのGeoIPを必要としますとしょうかん。次のいずれかを実行でき、モジュールを有効にするか、またはライブラリをインストールしないでください。
解决:
YUM -yのGeoIPのGeoIP-develのGeoIPのデータをインストール
再次配置
报错5:
./configureを:エラー:Googleサービスperftoolsモジュールでは、Google perftools必要と
ライブラリを。あなたはモジュールを有効またはライブラリをインストールしないことができます。
解决:
YUM gperftoolsをインストール**
再次配置成功

三、インストールしないでください作ります

第四に、元のバックアップnginxのバイナリファイルの
バックアップバイナリファイルとnginxの設定ファイル(nginxのがサービス中に停止しません)
[ルート@ VM-3のnginx-1.16.1]#mvのは/ usr / sbinに/ nginxのは/ usr / sbinに/ nginx_ $ (日付+%F)

第五に、新しいnginxのソースパッケージを入力し、新しいnginxのバイナリファイルをコピーし
、[ルート@ VM-3 nginx- 1.16.1]#cpは/root/nginx-1.16.1/objs/nginxは/ usr / sbinに/

第六に、正常のnginxの新バージョンをテスト
[ルート@のVM-3 nginx- 1.16.1]#nginxの-t
エラー:
nginxの:[EMERG]モジュールのバージョン1012002 "/usr/lib64/nginx/modules/ngx_http_geoip_module.so" INSTEAD /usr/share/nginx/modules/mod-http-geoip.conf:1で1016001
nginxの:テスト/etc/nginx/nginx.confコンフィギュレーションファイルに失敗しました
決意を:
VIM /etc/nginx/nginx.confは//設定を入力します。ファイル
のコメントにする#include /usr/share/nginx/modules/*.confを、
成功を再テスト

七、nginxの伝送信号へのスムーズな移行(不明瞭PIDパス、nginxのプロフィールを参照するか、見つけてください/ -name 'nginx.pid'見た目)
[ルート。3 nginxの-VM-1.16.1 @]#キル-USR2cat /run/nginx.pid

八、nginxののPIDを参照するように、そこであろうnginx.pid.oldbin
[ルート@ VM-3のnginx-1.16.1]#のLL / RUN / nginxの*
-rw-R - r--の1ルートルート5 9月6日00: 36 /run/nginx.pid
-rw-R&LTを-ルートにルートをr--の1 6 09月06日00:00に/run/nginx.pid.oldbin。

ナインは、優雅に古いnginxのプロセスをシャットダウンし
ます。[root @ VM-3 nginx- 1.16.1]#キル-WINCHcat /run/nginx.pid.oldbin

テン、その後、コンフィギュレーションをリロードしませんが、古い労働者を起動し
、[ルート@のVM-3 nginx- 1.16.1]#キル-HUPcat /run/nginx.pid.oldbin

XIは、業務プロセスの終わりには、アップグレード完了
[VM-3 nginx-ルート@を 1.16.1]#キル-QUITcat /run/nginx.pid.oldbin

nginxのアップグレードが成功したかどうかを確認する十二、
[ルート@のVM-3のnginx-1.16.1] -v#nginxの
nginxの/ 1.16.1:nginxのバージョン
の成功をアップグレード

おすすめ

転載: blog.51cto.com/14482279/2435975