ファイルを/ urs / localディレクトリにアップロードします。
nginx-1.18.0.tar.gz
ダウンロードリンク:http://nginx.org/en/download.html
tar zxvfnginx-1.18.0.tar.gzを実行して解凍します。
cd /usr/local/nginx-1.18.0
1、查看当前Nginx版本
[root @ test- 25nginx -1.18.0]#/ usr / local / nginx / sbin / nginx -V
nginxバージョン:nginx / 0.7.9
gcc 4.4.6 20120305(Red Hat 4.4.6-4)(GCC)によって構築された
構成引数:-prefix = / usr / local / nginx
2.nginxを構成してコンパイルします。インストールを行わないように
注意してください[root @ test-25 nginx-1.18.0]#。/ configure --prefix = / usr / local / nginx
[root @ test-25 nginx-1.18.0]#作る
3.元のnginxファイルをバックアップし、最新のファイルを使用します
ファイルの日付を
最初に確認します。[root @ test-25 nginx-1.18.0]
#ll / usr / local / nginx / sbin / nginx -rwxr-xr-x 1 root root 2337456 2015年8月12日/ usr / local / nginx / sbin / nginx
[root @ test-25 nginx-1.18.0] #mv / usr / local / nginx / sbin / nginx /usr/local/nginx/sbin/nginx.old
4.最新のファイル
[root @ test-25 nginx-1.18.0] #cp /usr/local/nginx-1.18.0/objs/nginx / usr / local / nginx / sbin / nginxを使用
して、ファイルの日付を確認します。
[root @ test-25 nginx-1.18.0]
#ll / usr / local / nginx / sbin / nginx -rwxr-xr-x 1 root root 3784415 Sep 2 16:31 / usr / local / nginx / sbin / nginx
5、升级nginx(一致右)
[root @ test-25 nginx-1.18.0] #make upgrade
/ usr / local / nginx / sbin / nginx -t
nginx:構成ファイル/ usr / local / nginx / conf / nginx .conf構文は問題あり
ませんnginx:構成ファイル/usr/local/nginx/conf/nginx.confテストは成功しました
kill -USR2 `cat / usr / local / nginx / logs / nginx.pid`
sleep 1
test -f / usr / local / nginx / logs / nginx.pid.oldbin
kill -QUIT `cat / usr / local / nginx / logs / nginx.pid.oldbin`
6.アップグレード後にバージョン情報を確認します(アップグレードは成功し、サービスは中断されません)
[root @ test-25 local]#/ usr / local / nginx / sbin / nginx -V
nginxバージョン:
gcc 4.4.620120305(Red Hat 4.4.6-4)(GCC)によってビルドされたnginx /1.18.0
引数を構成します:-prefix = / usr / local / nginx