Apache 因SSL Library Certificate has expired 無法啟動


1、查看服務日志,從/var/log/httpd/nss_error_log 文件中看到如下的錯誤:

[Sat Aug 20 08:17:49 2016] [error] NSS_Initialize failed. Certificate database: /etc/httpd/alias.
[Sat Aug 20 08:17:49 2016] [error] SSL Library Error: -8038 SEC_ERROR_NOT_INITIALIZED
[Sat Aug 20 08:17:49 2016] [error] NSS_Initialize failed. Certificate database: /etc/httpd/alias.
[Sat Aug 20 08:17:49 2016] [error] SSL Library Error: -8038 SEC_ERROR_NOT_INITIALIZED

提示說證書問題。查看下證書:發現時間過期

”certutil -d /etc/httpd/alias -L -n Server-Cert”

2、證書在安裝的時候默認時間是4年。

3、處理方法:

     1. 如果不需要用到mod_nss 模塊的,那直接把/etc/httpd/conf.d/nss.conf 文件改名或刪掉;
     2. 不驗證證書過期時間的,在nss.conf 中加入NSSEnforceValidCerts off 配置即可;
     3. 是重新生成新的證書;生成新證書前,務必先刪除舊證書數據庫文件

              cd /etc/httpd/alias

              rm -f *.db

              /usr/sbin/gencert /etc/httpd/alias > /etc/httpd/alias/install.log 2>&1

              certutil -d /etc/httpd/alias -L -n Server-Cert

              chmod 750 *.db(因為是在root下面操作的,生成的是權限是root權限)

重啟httpd

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM