下载新版本的包
1 |
[root@web03 ~]# wget http://nginx.org/download/nginx-1.19.2.tar.gz |
解压
1 |
[root@web03 ~]# tar xf nginx-1.19.2.tar.gz |
生成编译安装
1 2 3 |
[root@web03 ~]# cd nginx-1.19.2/ [root@web03 nginx-1.19.2]# ./configure --prefix=/usr/local/nginx-1.19.2 --user=www --group=www --with-http_addition_module --with-http_auth_request_module --without-http_gzip_module [root@web03 nginx-1.19.2]# make && make install |
替换配置文件
1 2 |
[root@web03 /usr/local]# cp nginx-1.18.0/conf/nginx.conf nginx-1.19.2/conf/ cp: overwrite ‘nginx-1.19.2/conf/nginx.conf’? y |
重启nginx
1 |
[root@web03 /usr/local]# systemctl restart nginx |