2017-11-15 10 views
0

SELinux가 설치된 CentOS 서버에서 Apache를 시작할 수 없습니다. 오류 로그에 나타납니다.CentOS에서 Apache를 시작할 수 없습니다. 개인 키가 없습니다.

[[email protected] httpd]# cat test-error_log 
[Wed Nov 15 05:42:34 2017] [error] Init: Private key not found 
[Wed Nov 15 05:42:34 2017] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag 
[Wed Nov 15 05:42:34 2017] [error] SSL Library Error: 218640442 error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error 
[Wed Nov 15 05:42:34 2017] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag 
[Wed Nov 15 05:42:34 2017] [error] SSL Library Error: 218595386 error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error 
[Wed Nov 15 05:42:34 2017] [error] SSL Library Error: 67710980 error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib 
[Wed Nov 15 05:42:34 2017] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag 
[Wed Nov 15 05:42:34 2017] [error] SSL Library Error: 218595386 error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error 

또한

[[email protected] private]# openssl rsa -in test.key -check -noout 
unable to load Private Key 
140598241089352:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1319: 
140598241089352:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:381:Type=RSA 
140598241089352:error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib:rsa_ameth.c:115: 
140598241089352:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1319: 
140598241089352:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:381:Type=PKCS8_PRIV_KEY_INFO 
140598241089352:error:0907B00D:PEM routines:PEM_READ_BIO_PRIVATEKEY:ASN1 lib:pem_pkey.c:132: 

경로는 나는 또한 개인 키에 공백이 없는지 체크 conf의 파일

[[email protected] conf]# cat /etc/httpd/conf.d/test.conf 
<VirtualHost *:443> 
ServerAdmin [email protected] 
DocumentRoot /var/www/html/test 
ServerName server.server.com 

SSLEngine on 
SSLProtocol all -SSLv2 -SSLv3 
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW 
SSLCertificateFile /etc/pki/tls/certs/test.crt 
SSLCertificateKeyFile /etc/pki/tls/private/test.key 


ErrorLog logs/test-error_log 
CustomLog logs/test-access_log common 

에 여기 실패합니다. 이것이 잘못되어 가고있는 다른 아이디어?

또한
[[email protected] etc]# ls -dZ /etc/pki/tls/private/ 
drwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 /etc/pki/tls/private/ 
[[email protected] etc]# ls -dZ /etc/pki/tls/certs/ 
drwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 /etc/pki/tls/certs/ 

나는 또한 개인 키 및 대시 적절한 수의 공백이 없는지 확인했다.

편집 : -al은/etc/PKI/TLS/개인 /과 LS -al LS의 출력은/등/PKI/TLS/인증서 표시/

[[email protected] ~]# ls -al /etc/pki/tls/certs/ 
total 1788 
drwxr-xr-x. 2 root root 4096 Nov 15 08:51 . 
drwxr-xr-x. 5 root root 4096 Feb 11 2015 .. 
-rw-r--r--. 1 root root 786601 Jul 14 2014 ca-bundle.crt 
-rw-r--r--. 1 root root 1005005 Jul 14 2014 ca-bundle.trust.crt 
-rw-------. 1 root root 1513 Feb 11 2015 localhost.crt 
-rwxr-xr-x. 1 root root  610 Jan 20 2015 make-dummy-cert 
-rw-r--r--. 1 root root 2242 Jan 20 2015 Makefile 
-rwxr-xr-x. 1 root root  829 Jan 20 2015 renew-dummy-cert 
-rw-r--r--. 1 root root 1208 Feb 11 2015 test.crt 
-rw-------. 1 root root 3258 Nov 15 08:51 test_1.cert 
[[email protected] ~]# ls -al /etc/pki/tls/private/ 
total 16 
drwxr-xr-x. 2 root root 4096 Nov 18 21:15 . 
drwxr-xr-x. 5 root root 4096 Feb 11 2015 .. 
-rw-------. 1 root root 1679 Feb 11 2015 localhost.key 
-rw-r--r--. 1 root root 1679 Nov 18 21:15 test.key 
[[email protected] ~]# 

답변

0

는 당신이 개인 키는 암호화되어 있습니까? 는 개인 키가 암호화되어 있는지 확인하려면 :

grep ENCRYPTED /etc/pki/tls/private/test.key 

예라면, 개인 키에서 암호를 제거 :

openssl rsa -in /etc/pki/tls/private/test.key -out /etc/pki/tls/private/test-new.key 

확인 개인 키의 헤더, 다음과 같아야합니다

-----BEGIN RSA PRIVATE KEY----- 

그리고 바닥 글을 확인, 다음과 같아야합니다

-----END RSA PRIVATE KEY----- 

바닥 글 뒤에 공백이나 줄 바꾸기를 제거하십시오.

희망이 있습니다.

+0

암호화되지 않았으며 시작 부분이나 끝 부분에 공백이 있는지 확인했습니다. 다른 아이디어? – MarshawxLynch

+0

'ls -al/etc/pki/tls/certs /'와'ls -al/etc/pki/tls/private /'의 내용을 나열 할 수 있습니까? – sys0dm1n

+0

주요 질문에 추가되었습니다. – MarshawxLynch