一、准备
1. 新建一个目录存放安装包。可以放在/root/nginx 。
2. 升级前对原nginx的配置文件 ‘ nginx.conf ’ 做下备份。
3. 先查看下当前nginx安装位置和版本号。
ps -ef | grep nginx
root 115149 1 0 14:18 ? 00:00:00 nginx: master process /usr/local/nginx-1.13.4/sbin/nginx
nobody 115150 115149 0 14:18 ? 00:00:00 nginx: worker process
root 115208 110517 0 14:50 pts/0 00:00:00 grep nginx
/usr/local/nginx-1.13.4/sbin/nginx -V
nginx version: nginx/1.13.4
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx-1.13.4 --with-http_stub_status_module --with-http_ssl_module
二、开始升级 gogogo ~
1. 解压下载的新版本nginx文件
cd /root/nginx
tar -zxvf nginx-1.16.1.tar.gz
cd nginx-1.16.1
./configure --prefix=/usr/local/nginx-1.13.4 --with-http_stub_status_module --with-h