今天正式環境網站宕機,根據nginx的錯誤日志是因為nginx本身版本太低的問題,是nginx自身的bug
error.log報的錯誤信息如下:
2017/11/02 16:59:49 [crit] 68660#0: *34431 SSL_shutdown() failed (SSL: error:140E0197:SSL routines:SSL_shutdown:shutdown while in init) while closing request, client: 10.2.21.75, server: 0.0.0.0:443
2017/11/02 16:59:54 [crit] 68661#0: *36315 SSL_shutdown() failed (SSL: error:140E0197:SSL routines:SSL_shutdown:shutdown while in init) while closing request, client: 222.221.169.145, server: 0.0.0.0:443
2017/11/02 16:59:54 [crit] 68661#0: *36316 SSL_shutdown() failed (SSL: error:140E0197:SSL routines:SSL_shutdown:shutdown while in init) while closing request, client: 222.221.169.145, server: 0.0.0.0:443
2017/11/02 16:59:54 [crit] 68661#0: *36314 SSL_shutdown() failed (SSL: error:140E0197:SSL routines:SSL_shutdown:shutdown while in init) while closing request, client: 222.221.169.145, server: 0.0.0.0:443
2017/11/02 16:59:55 [crit] 68661#0: *36388 SSL_shutdown() failed (SSL: error:140E0197:SSL routines:SSL_shutdown:shutdown while in init) while closing request, client: 222.172.244.195, server: 0.0.0.0:443
據網上搜索,可以確定應該是nginx的問題,於是決定升級nginx,解壓后執行./configure時報錯如下:
./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option.
於是安裝pcre-devel解決問題
yum -y install pcre-devel 但是提示
在網上搜的類似yum命令均提示已安裝並且是最新版本 ,但是安裝新版本nginx依舊提示缺少pcre
於是自己下載pcre-8.37.tar.gz 、安裝、成功 , 再執行安裝nginx、成功了..........
經過仔細研究終於發現問題所在,原來pcre和pcre-devel是兩個包,安裝失敗並非是yum命令的原因,相反安裝的時候能用yum盡量用yum安裝
所以正確的yum命令應該是 yum install pcre pcre-devel 要安裝這兩個包
其過程中值得注意的點:1、執行make && make install 時不要少打&(這里很坑!總忘!唉!)