nginx升级1.20.1版本

下载新版本nginx

wget http://nginx.org/download/nginx-1.20.1.tar.gz

停止旧nginx

ps -ef |grep nginx
kill 1520

备份配置文件

mv /usr/local/nginx/sbin/nginx /home/softwware/nginx.old

mv /usr/local/nginx/conf/nginx.conf  /home/softwware/nginx.conf.old

查看旧版本编译参数

/usr/local/nginx/sbin/nginx -V

解压新nginx

tar -zxvf nginx-1.20.1.tar.gz

编译不安装

注意与查看旧版本编译参数一致

./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.40 --with-zlib=/usr/local/src/zlib-1.2.11 --with-openssl=/usr/local/openssl-1.1.0f

make

 复制nginx文件覆盖旧版本文件

 cp /home/sofeware/nginx-1.20.1/objs/nginx /usr/local/nginx/sbin/nginx

启动新nginx

/usr/local/nginx/sbin/nginx

你可能感兴趣的:(linux,负载均衡,nginx)