nginx从1.9.9升级到1.16.1

nginx从1.9.9升级到1.16.1的问题,记录下

因为老版本有如下的漏洞:
  1. nginx 安全漏洞(CVE-2019-9511) 漏洞
  2. nginx 安全漏洞(CVE-2019-9513) 漏洞
  3. nginx 安全漏洞(CVE-2019-9516) 漏洞
升级到1.16.1就解决了三个漏洞。简单粗暴的方式就是删除,重新安装。
删之前请先停掉nginx。

先查找所有的nginx,然后再删除掉 代码片.

find / -name nginx*
rm -rf /路径/nginx*

然后解压下载的nginx-1.16.1.tar.gz文件,再配置ssl,最后make下代码片.

tar -xzvf nginx文件
cd nginx
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-pcre
make
make install

cd到sbin目录,查看版本号

./nginx -V
nginx version: nginx/1.16.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled

最后在看看能不能运行

./nginx -t
nginx: [alert] could not open error log file: open() "/usr/local/app/nginx/logs/error.log" failed (2: No such file or directory)
nginx: the configuration file /usr/local/app/nginx/conf/nginx.conf syntax is ok
[emerg] 570#0: open() "/usr/local/app/nginx/logs/nginx.pid" failed (2: No such file or directory)
nginx: configuration file /usr/local/app/nginx/conf/nginx.conf test failed

如何跟我一样报这个错误,是因为nginx目录下没的logs这个文件夹,新建一个就OK了。
最后再试试。

./nginx -t
nginx: the configuration file /usr/local/app/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/app/nginx/conf/nginx.conf test is successful

成功,就./nginx启动,ps查看下

ps -ef|grep nginx
root      2578     1  0 18:59 ?        00:00:00 nginx: master process ./nginx
nobody    2579  2578  0 18:59 ?        00:00:00 nginx: worker process
root      2612  7939  0 18:59 pts/1    00:00:00 grep --color=auto nginx

大功告成!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值