apache伺服器故障排除一例
單位有一台VoIP伺服器,使用的是redhat系統,其配置界面使用的是以Apache和PHP搭建的web伺服器,今天突然發現配置界面登不上去了,遂開始排錯。
1.故障現象
網頁登不上,重啟伺服器,重啟httpd服務均報如下錯誤:
Could not reliably determine the server』s fully qualified domain name, using 127.0.1.1 for ServerNamen
2.根據網上查到的解決方案,修改httpd的配置文件
[root@server1]# find / -type f -name httpd.confn/etc/httpd/conf/httpd.confn[root@server1]# vi /etc/httpd/conf/httpd.confnServerName localhost:80n
3.重啟服務查看效果
[root@server1]# service httpd restartn停止 httpd: [失敗]n啟動 httpd: [失敗]n
4.上一個問題解決了,但是還是失敗,看來還得查查apache的錯誤日誌
[root@server1]# vi /etc/httpd/conf/httpd.confn/error_lognError_log "logs/error_log"n[root@server1]# tail /etc/httpd/logs/error_logn[Thu Nov 16 15:59:45 2017] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)n[Thu Nov 16 15:59:46 2017] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)n[Thu Nov 16 15:59:51 2017] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)n
5.找到原因,是mod_nss證書過期導致:
首先檢查apache的error_log,我在/etc/httpd/logs/nss_error_log文件中看到如下錯誤。
[Mon Dec 26 13:21:24 2011] [error] Certificate not verified: Server-Cert[Mon Dec 26 13:21:24 2011] [error] SSL Library Error: -8181 Certificate has expired[Mon Dec 26 13:21:24 2011] [error] Unable to verify certificate Server-Cert. Add "NSSEnforceValidCerts off" to nss.conf so the server can start until the problem can be resolved.n
解決方法如下:
[root@server1]# vi /etc/httpd/conf.d/nss.confn#NSSEngine onnNSSEngine offn
6.檢查效果
[root@server1]# service httpd restartn停止 httpd: [成功]n啟動 httpd: [成功]n[root@server1]# netstat -lntup|grep 80ntcp 0 0 :::80 :::* LISTENn[root@server1]# ps aux |grep httpdn
推薦閱讀:
※python如何抓取本地數據包?
※項目做到什麼程度才可以進入Apache Incubator(Apache孵化器)?
※Apache新成員:LinkedIn分散式數據集成框架Gobblin
※Web 應用、服務是如何工作的?
※PHP寫的API如何防止拒絕服務攻擊?