安装 Comodo 的 SSL 证书后这些说明,我发现 apache 无法启动。这是我的配置:
<VirtualHost *:80>
ServerName latimer.io
ServerAlias *.latimer.io
ServerAdmin webmaster@localhost
DocumentRoot /var/www/latimer.io/html
# RewriteEngine On
# RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>
<VirtualHost *:443>
ServerName latimer.io
ServerAlias *.latimer.io
ServerAdmin webmaster@localhost
DocumentRoot /var/www/latimer.io/html
SSLEngine On
SSLCertificateKeyFile /etc/ssl/server.key.secure
SSLCertificateFile /etc/ssl/latimer_io.crt
SSLCertificateChainFile /etc/ssl/latimer_io.ca-bundle
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Apache 错误日志给出以下(不太有帮助的)错误:
[ssl:emerg] [pid 30910] AH02240: Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile] ((null):0)
[ssl:emerg] [pid 30910] AH02312: Fatal error initialising mod_ssl, exiting.
但运行 apache2ctl -S 不会产生任何错误。任何有关如何继续的指导都值得赞赏。其他描述相同、一般错误的 serverfault 页面未能成功解决问题。
答案1
我重新安装了 Apache,问题解决了。一定是有什么东西损坏了。