无法启动 apache2 服务器。错误信息如下。
调查类似的问题(SSL 错误 - 无法从文件读取服务器证书, Apache 无法读取证书文件等等),仍然卡在这个问题上。欢迎任何帮助。谢谢。
me@localhost:/etc/apache2$ sudo service apache2 start
* Starting web server apache2 Action 'start' failed.
The Apache error log may have more information.
[fail]
me@localhost:/etc/apache2$ sudo apachectl configtest
Syntax OK
错误日志:
[Thu Dec 17 17:24:11 2015] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
[Thu Dec 17 17:24:11 2015] [error] SSL Library Error: 218595386 error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error
[Thu Dec 17 17:25:27 2015] [error] Init: Unable to read server certificate from file /opt/conf/apache-portal-config/etc/ssl/server.crt
运行验证证书文件时openssl x509 -noout -text -in
,一切正常。
更新
运行openssl rsa -in server.key -out server.out.key
,输出为:
unable to load Private Key
140374406153888:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting: ANY PRIVATE KEY