CentOS Apache無法啟動 httpd開機無法啟動

2016.12.15 (W4)

終於輪到我遇到了,今天早晨Cent OS 主機重開之後就發生httpd無法啟動的問題,印象中之前也遇過一次,最後好像是整個CentOS砍掉重練,這工程浩大啊,這次google了一下網路上的文章,還好有解決,所以自己也寫一篇分享出來給各位。

所有的服務除了httpd沒法啟動之外,其餘的服務都已經正常啟動,比如說mysqld…….等等

首先先確認httpd無法啟用

# service httpd restart
Stop httpd    [FAILED]
Start httpd   [FAILED]

確認httpd error log file

# grep suexec /var/log/httpd/error_log

[root@www conf.d]# grep suexec /var/log/httpd/error_log
[Thu Dec 15 08:11:48 2016] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 15 08:14:40 2016] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 15 08:36:29 2016] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 15 08:50:16 2016] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 15 08:50:18 2016] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 15 08:54:21 2016] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 15 09:11:31 2016] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

確認 httpd nss error log file

#tail -300 /var/log/httpd/error_log

[Thu Dec 15 08:50:18 2016] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 15 08:50:18 2016] [error] SSL Library Error: -8181 Certificate has expired
[Thu Dec 15 08:50:18 2016] [error] Unable to verify certificate ‘Server-Cert’. Add “NSSEnforceValidCerts off" to nss.conf so the server can start until the problem can be resolved.
[Thu Dec 15 08:54:21 2016] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 15 08:54:22 2016] [error] SSL Library Error: -8181 Certificate has expired
[Thu Dec 15 08:54:22 2016] [error] Unable to verify certificate ‘Server-Cert’. Add “NSSEnforceValidCerts off" to nss.conf so the server can start until the problem can be resolved.

第一種處理方式(不過我這邊試過我的沒用 XD)

把nss.conf 更名
#cd /etc/httpd/conf.d
#mv nss.conf nss.conf.orig
啟動httpd服務
#service httpd restart
Starting httpd: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf.d/revocator.conf: Cannot load /etc/httpd/modules/mod_rev.so into server: /etc/httpd/modules/mod_rev.so: undefined symbol: nss_die
[FAILED]

第二種處理方式(有成功)

修改 /etc/httpd/conf.d/nss.conf 裡的 NSSEngine 這個參數為 off 來關閉這個訊息

修改好之後,重新啟動httpd,完成。

分類: 知識庫  標籤: , ,  發表評論
您可訂閱我的文章,系統支援 RSS 2.0 . 您可以 留下回應, 或是 引用 此篇文章到您的網站.


發表迴響