CentOS下Nginx從6升級到8後的問題匯總

CentOSNginx6升級到8後的問題匯總

系統是CentOS 5

因為最近爆的Nginx的安全漏洞,所以著手升級Nginx

先升級一台從前端,出現的問題是ssl證書的問題

1.日誌報錯,並且新程序起不來

2011/08/26 17:55:21 [emerg] 6336#0: SSL_CTX_use_PrivateKey_file(“/etc/nginx/ssl/xxx.key”) failed (SSL: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt error:0906A065:PEM routines:PEM_do_header:bad decrypt error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib)

然後查閱 nginx官網http://wiki.nginx.org/HttpSslModule

發現他們做sslkey的時候多做一步

cp server.key server.key.org

openssl rsa -in server.key.org -out server.key

之前我直接用默認的 server.key,每次啟動nginx都要啟動的,然後現在使用這個新key之後,啟動不需要密碼。

2.換到主前端之後,看啟動沒問題,但是日誌報錯:

2011/08/27 14:52:42 [emerg] 21997#0: eventfd() failed (38: Function not implemented)
2011/08/27 14:52:42 [alert] 21988#0: worker process 21989 exited with fatal code 2 and can not be respawn

並且看進程,只有一個主程序在啟動,埠也連不上

到網上搜索錯誤日誌,大體表明:Nginx 使用 Linux-native aio 需要 Linux 內核支持

主前端機的內核的確比較老(從前端的升級過),2.6.18-164.el5,然後升級到最新的2.6.18-238.19.1.el5,重啟後正常

看官網論壇解釋:

You have to recompile nginx *without* –with-file-aio configure
option.

Your system lacks eventfd() support and nginx compiled with
–with-file-aio configure option (on another host? compile on the
host in question with –with-file-aio should fail unless your
system headers screwed up) won’t work on it.

大意是你需要重新編譯nginx 並且
不帶–with-file-aio這個參數,問題產生原因是系統不支持 eventfd() ,但是nginx卻帶–with-file-aio編譯的。所以就出問題

所以。對於server來說,整體升級也是必要的,因為全升到最新,程序必然是沒有問題的,但是只升級一個,有問題人家也不告訴我們。

以下文章點擊率最高

Loading…

     

如果這文章對你有幫助,請掃左上角微信支付-支付寶,給於打賞,以助博客運營