gpt4 book ai didi

Apache - 安装 SSL 证书

转载 作者:太空宇宙 更新时间:2023-11-03 13:52:04 25 4
gpt4 key购买 nike

我是 ssl 证书和在 apache 上安装的新手。我有以下虚拟主机设置

<VirtualHost *:443>
ServerName www.beta.mysite.com
SSLEngine on
SSLCertificateFile /home/ec2-user/sslCerts/beta_mysite_com.crt
SSLCertificateKeyFile /home/ec2-user/sslCerts/mySite.key
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
</VirtualHost>

证书的所有路径均有效当我运行 apache 启动命令时,出现以下错误

Starting httpd: [Sun Oct 23 12:34:37 2016] [warn] _default_ VirtualHost overlap on port 443, the first has precedence

此外 - 我的 ssl_error.log 文件显示以下错误

[Sun Oct 23 12:34:37 2016] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun Oct 23 12:34:37 2016] [warn] RSA server certificate CommonName (CN) `ip-172-55-16-165' does NOT match server name!?
[Sun Oct 23 12:34:37 2016] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun Oct 23 12:34:37 2016] [warn] RSA server certificate CommonName (CN) `ip-172-55-16-165' does NOT match server name!?

知道我需要做什么才能正确设置 ssl 吗?

最佳答案

肯定有两个虚拟主机配置为使用端口 443。请确认并检查您运行的 Apache 服务器是否启用了 SNI。也就是说,一个 IP 一个端口可以用来配置多个 URL 和 ssl 证书。如果是,请在虚拟主机中提及确切的 url,如下所示:

VirtualHost mysite1.abc.com:443 
VirtualHost mysite2.abc.com:443

您提到的第二个错误表明基于 IP 的 SSL 证书已绑定(bind)到基于域的网站。我不确定哪个虚拟主机正在使用基于 IP 的 SSL。您可以运行以下命令来查看证书内容:

openssl x509 -inform pem -in cerfile.cer -noout -text.

找到使用的虚拟主机后,将证书替换为您从 CA 购买的证书。

关于Apache - 安装 SSL 证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40202968/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com