首页 > 系统相关 >Nginx 平滑升级

Nginx 平滑升级

时间:2023-06-02 09:44:04浏览次数:30  
标签:http logs nginx -- 平滑 升级 Nginx usr local

Nginx 平滑升级

nginx/1.20.1 --->1.22.1

1、查看原编译参数

nginx -V
--------------------------------------------
nginx version: nginx/1.20.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --with-http_stub_status_module --with-http_ssl_modul

2、解压源码进行编译

1)解压
tar -zxvf nginx-1.22.1.tar.gz
2)配置编译
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make
3、备份替换nginx文件
1)备份原来 nginx 二进制文件
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
2) 复制新的nginx二进制文件
cp /data/software/nginx-1.22.1/objs/nginx /usr/local/nginx/sbin
3)测试nginx是否正常
nginx -t
4) 平滑升级
kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
test -f /usr/local/nginx/logs/nginx.pid.oldbin
kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`

标签:http,logs,nginx,--,平滑,升级,Nginx,usr,local
From: https://www.cnblogs.com/wsx2019/p/17450919.html

相关文章

  • Nginx:CVE-2021-23017;CVE-2022-41742
    nginx安全漏洞(CVE-2021-23017)详细描述Nginx是美国Nginx公司的一款轻量级Web服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器。nginx存在安全漏洞,该漏洞源于一个离一错误在该漏洞允许远程攻击者可利用该漏洞在目标系统上执行任意代码。受影响版本0.6.18-1.20.0解决......
  • NGINX版本信息泄露
    NGINX版本信息泄露详细描述在请求的响应信息中显示Nginx版本信息影响攻击者可能使用泄露的版本信息来确定该版本服务器有哪些安全漏洞,据此展开进一步的攻击。解决办法Nginx配置文件里增加server_tokensoff;官方语法说明:http://nginx.org/en/docs/http/ngx_http_core......
  • 银河麒麟v10操作系统之nginx 安装&部署
    yum-yinstallgccpcrepcre-develzlibzlib-developensslopenssl-devel安装的插件的作用1.gcc可以编译C,C++,Ada,ObjectC和Java等语言(安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境)2.pcrepcre-develpcre是一个perl库,包括perl兼容的正则表达......
  • Linux 系统升级node18
    解决/lib64/libc.so.6:versionGLIBC_2.28‘notfound解决方案:升级glibc到2.28版本wgethttps://mirror.bjtu.edu.cn/gnu/libc/glibc-2.28.tar.xztar-xfglibc-2.28.tar.xz-C/usr/local/cd/usr/local/glibc-2.28/mkdirbuildcdbuild/../configure--prefix=/usr/lo......
  • nginx 配置 https
    nginx配置https按照如下格式修改配置文件,80端口会自动转给443端口,这样就强制使用SSL证书加密了。访问http的时候会自动跳转到https上面。server{listen80;server_namewww.域名.com;rewrite^(.*)https://$server_name$1permanent;}server{listen443;se......
  • nginx 负载均衡
    负载均衡http://nginx.org/en/docs/http/load_balancing.html轮询(不写directive )upstreammyapp1{serversrv1.example.com;serversrv2.example.com;serversrv3.example.com;}最小活跃连接数upstreammyapp1{lea......
  • 离线安装nginx
    离线安装nginxgcc-c++该链接内有安装nginx所需的环境openssl、pcre、zlib直接执行该命令安装即可rpm-Uvh*.rpm--nodeps--force将下载好的nginx源码包(nginx-1.21.6.tar.gz)解压缩到/usr/local目录下,顺序执行以下命令cdnginx-1.21.6./configuremake&&makeinstall......
  • Nginx配置隐藏模块后的.php后缀
    要在Nginx中配置隐藏框架模块后的.php后缀,并将URL重写为http://example.com/index/user/profile,请按照以下步骤进行操作:1.  打开Nginx配置文件。2.  添加以下配置,启用URL重写和模块隐藏:server{listen80;server_nameexample.com;root/pat......
  • nginx+tomcat+https
    nginx:config :location/{add_headerContent-Security-Policyupgrade-insecure-requests;proxy_passhttp://127.0.0.1:8080;proxy_set_headerHost$host:$server_port;proxy_set_headerREMOTE_HOST$remote_addr;proxy_set_headerX-Real-IP$remot......
  • 迈辉门窗系统升级,定义中高端系统门窗新标准
    据观研报告网发布的《2022中国定制门窗行业发展趋势研究报告》相关研究报告数据显示,我国门窗目前市场规模约4000亿-5000亿,而已在欧美广泛使用、更低碳环保的系统门窗,目前在国内仅占1%左右,市场潜力亟待爆发,巨大的商机让高端门窗行业发展如火如荼,也推动了一批知名门窗品牌的诞生。作......