Apache - 安装 SSL 证书
Apache - Installing SSL Cert
我是 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 吗?
@hjpotter92 是正确的 - 为端口 443 配置了 2 个虚拟主机
当我运行下面的命令
yum 安装 mod_ssl openssl
它生成文件 conf.d 和文件 ssl.conf
我在 conf/httpd.conf 中也有一个用于端口 443 的虚拟主机
我删除了 conf/httpd.conf 中的虚拟主机并在 conf.d/ssl.conf 中配置了虚拟主机,现在一切正常
肯定有两个虚拟主机配置为使用port 443
。请确认并检查您 运行ning 的 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 购买的证书。
我是 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 吗?
@hjpotter92 是正确的 - 为端口 443 配置了 2 个虚拟主机
当我运行下面的命令 yum 安装 mod_ssl openssl
它生成文件 conf.d 和文件 ssl.conf 我在 conf/httpd.conf 中也有一个用于端口 443 的虚拟主机 我删除了 conf/httpd.conf 中的虚拟主机并在 conf.d/ssl.conf 中配置了虚拟主机,现在一切正常
肯定有两个虚拟主机配置为使用port 443
。请确认并检查您 运行ning 的 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 购买的证书。