【发布时间】:2016-07-11 12:55:21
【问题描述】:
Apache 无法启动,出现错误...
1:08:52 a.m. [Apache] Error: Apache shutdown unexpectedly.
1:08:52 a.m. [Apache] This may be due to a blocked port, missing dependencies,
1:08:52 a.m. [Apache] improper privileges, a crash, or a shutdown by another method.
1:08:52 a.m. [Apache] Press the Logs button to view error logs and check
1:08:52 a.m. [Apache] the Windows Event Viewer for more clues
1:08:52 a.m. [Apache] If you need more help, copy and post this
1:08:52 a.m. [Apache] entire log window on the forums
在我按照these instructions 生成自签名证书之前,Apache 正在工作。我还使用端口 443 重定向更新了虚拟主机文件。
Apache 日志没有告诉我任何有用的信息,因为在尝试启动 Apache 时不会生成错误。我检查了 netstat,443 上什么都没有。
编辑:我通过注释掉重新启动了服务器
# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf
所以我的 SSL 配置中的某些东西导致它无法启动。据我所知,我已经在 SSL 配置中正确设置了证书和密钥文件。
编辑 2:运行 httpd -t 我收到错误 SSLCertificateFile: file 'C:/my/xampp/location/apache/conf/ssl.crt/server.crt' does not exist or is empty
果然我创建的crt文件是空的!关键文件不是。我会尝试重新创建它。
编辑 3:好的,我重新创建了 .crt 和密钥文件,它们都有内容。 conf 语法通过,但 Apache 不会启动。我现在可以看到一个错误:Certificate and private key www.example.com:443:0 from /conf/ssl.crt/server.crt and /conf/ssl.key/server.key do not match
AH00016: Configuration Failed
在设置证书时,我是否必须具有通用名称,与服务器名称完全匹配?即如果虚拟主机中的服务器名称是 www.example.com:443,我是否必须在完全限定的域 URL 公用名中包含端口?
编辑 4:现在我的配置看起来不错,我尝试了 different tutorial,证书似乎还可以,但我收到错误 described here。 openssl x509 -in my.crt -text 表示证书末尾有一个奇数大小的块。我不明白新生成的证书是如何损坏的。我错过了什么吗?
背景是我在尝试设置 Let's Encrypt 为我的 Win XAMPP 服务器生成可移植 SSL 证书时出错(我在 Ubuntu 机器上执行此操作,因为在那里使用客户端更容易)。但我得到了“Correct zName not found for TLS SNI challenge”。其中一个建议是先拥有一个自签名证书。这导致我尝试上述方法。
【问题讨论】:
-
Sheldon,这就像你在告诉我不知道答案。我想说几个小时研究和尝试不同的建议远非猜测。这是我第一次尝试实现 SSL,但对我来说并不容易。