環境
OS:CentOS Linux release 7.4.1708 (Core)
nginx version: nginx/1.12.1
●nginxのバージョンの確認方法
# ps aux |grep nginx root 1489 0.0 0.0 70536 3820 ? Ss 2021 0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf nobody 17351 0.0 0.0 84896 6404 ? S 3月14 0:22 nginx: worker process root 24063 0.0 0.0 112676 976 pts/0 S+ 17:47 0:00 grep --color=auto nginx # /usr/local/nginx/sbin/nginx -v nginx version: nginx/1.12.1
nginxのバージョンを最新に上げるにはどうしたらよいのでしょうか?
【試した事1】
ググって下記の方法を行いました。
1.アップデート
# yum update --enablerepo=nginx nginx : 更新: nginx.x86_64 1:1.20.2-1.el7.ngx 完了しました!
2.バージョンを確認
# /usr/local/nginx/sbin/nginx -v nginx version: nginx/1.12.1 ※バージョン変わらず # nginx -v nginx version: nginx/1.20.2 ※?
起動している「/usr/local/nginx/sbin/nginx」のバージョンを上げたいのに上がってない。
【試した事2】
ググって
1.nginx-1.20.2.tar.gzを取得後、解凍
# wget https://nginx.org/download/nginx-1.20.2.tar.gz # tar -xvzf nginx-1.20.2.tar.gz
2.既存のconfigure argumentsを取得
# /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.20.2 : configure arguments: --prefix=XXXXXXXX
3.nginx-1.20.2のconfigureに既存のconfigure argumentsを設定
# ./configure --prefix=XXXXXXXXXX
4.ビルド、objsフォルダーが出来る
# make
5.バージョンとconfigureを確認
# ./objs/nginx -V nginx version: nginx/1.20.2 : configure arguments: --prefix=XXXXXX
6.設定が正しい確認
# objs/nginx -t nginx: [emerg] unknown directive "passenger_root" in /usr/local/nginx-1.12.1/conf/nginx.conf:8 nginx: configuration file /usr/local/nginx-1.12.1/conf/nginx.conf test failed
エラー、なので下記コマンドで上書きする予定だったが出来ず
# cp objs/nginx /usr/local/nginx/sbin/nginx
起動している「/usr/local/nginx/sbin/nginx」のバージョンを上げたいのですが、どのようにしたらよいのでしょうか?
ご教授の程よろしくお願い致します。

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/03/18 02:18
2022/03/18 05:25 編集