1、案例采用版本介绍
旧版本 nginx-1.12.2.tar.gz
新版本 nginx-1.20.1.tar.gz
2、nginx-1.12.2版本为当前运行版本
nginx -V 查看configure
然后解压新版本1.20 cd 进入
./configure --user=nginx --group=nginx --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-file-aio --with-http_v2_module --with-pcre --with-ld-opt=-ljemalloc
make
在这里有个分歧 有人认为make不要make install
我是make 之后 发现 /usr/sbin/nginx 的nginx变成了nginx.old 于是我就make install 然后/usr/sbin/下就有了nginx 然后nginx -V 发现已经变成了 nginx-1.20
还有一种是这样的
最后还需要已经打开的进程 进行切换