【问题标题】:Apache - Installing SSL CertApache - 安装 SSL 证书
【发布时间】:2017-03-05 07:39:05
【问题描述】:

我是 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 start 命令时,出现以下错误

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 吗?

【问题讨论】:

  • 基本上,您有 2 个用于端口 443 的 VHost 配置

标签: apache ssl https certificate


【解决方案1】:

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

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

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

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

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

【讨论】:

    【解决方案2】:

    @hjpotter92 是正确的 - 为端口 443 配置了 2 个虚拟主机

    当我运行以下命令时 yum install mod_ssl openssl

    它使用文件 ssl.conf 生成文件 conf.d 我还在 conf/httpd.conf 中有一个用于端口 443 的虚拟主机 我删除了 conf/httpd.conf 中的虚拟主机,并在 conf.d/ssl.conf 中配置了虚拟主机,现在一切正常

    【讨论】:

      猜你喜欢
      • 2016-12-24
      • 2014-06-26
      • 1970-01-01
      • 2016-08-30
      • 2015-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-20
      相关资源
      最近更新 更多