1. 아파치 재시작이 안 될때..
2. 아파치 로그 확인
아래와 같은 에러 메시지들 발견
[root@test logs]# tail -f error_log
[Mon Dec 03 09:32:38 2018] [error] Unable to verify certificate 'Server-Cert'. Add "NSSEnforceValidCerts off" to nss.conf so the server can start until the problem can be resolved.
[Mon Dec 03 09:56:26 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Dec 03 09:56:27 2018] [error] SSL Library Error: -8181 Certificate has expired
[Mon Dec 03 09:56:27 2018] [error] Unable to verify certificate 'Server-Cert'. Add "NSSEnforceValidCerts off" to nss.conf so the server can start until the problem can be resolved.
[Mon Dec 03 09:56:51 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Dec 03 09:56:51 2018] [error] SSL Library Error: -8181 Certificate has expired
[Mon Dec 03 09:56:51 2018] [error] Unable to verify certificate 'Server-Cert'. Add "NSSEnforceValidCerts off" to nss.conf so the server can start until the problem can be resolved.
[Mon Dec 03 10:03:56 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Dec 03 10:03:56 2018] [error] SSL Library Error: -8181 Certificate has expired
[Mon Dec 03 10:03:56 2018] [error] Unable to verify certificate 'Server-Cert'. Add "NSSEnforceValidCerts off" to nss.conf so the server can start until the problem can be resolved.
위 에러메시지들 구글링해서 살펴봄
3. 문제 확인
아래 유효기간이 지나서 발생한 거라고 함.
nss 옵션을 끄고 삭제 뒤 다시 설치하기로 함
[root@test ssl]# certutil -d /etc/httpd/alias -L -n Server-Cert
Certificate:
Validity:
Not After : Sat Dec 01 12:14:49 2018
Subject: "CN=DBserver,O=example.com,C=US"
Subject Public Key Info:
4. 해결
- nss.conf 파일 위치 파악
[root@test ssl]# find / -name nss.conf
/etc/httpd/conf.d/nss.conf
- 아래 문구 없다면 nss.conf 파일 맨 아래 줄에 추가
NSSEnforceValidCerts off
- 재생성을 위한 기존 자료 삭제
[root@test alias]# cd /etc/httpd/alias/
[root@test alias]# ls
cert8.db install.log key3.db libnssckbi.so secmod.db
위 검색된 3개의 파일 삭제
[root@test alias]# rm -f cert8.db key3.db secmod.db
- 삭제 뒤 아래 문구 그대로 실행
/usr/sbin/gencert /etc/httpd/alias
- mod_nss 재설치
[root@test alias]# yum remove mod_nss
[root@test alias]# yum install mod_nss
- 아파치 서버 재가동
apachectl stop
apachectl -k start
정상적으로 접속됨을 확인