Apache-安装SSL证书

Apache-安装SSL证书,apache,ssl,https,certificate,Apache,Ssl,Https,Certificate,我是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 ProxyPas

我是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>
另外-my ssl_error.log文件显示以下错误

Starting httpd: [Sun Oct 23 12:34:37 2016] [warn] _default_ VirtualHost overlap on port 443, the first has precedence
[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个vhost

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

它使用ssl.conf文件生成conf.d文件 我在conf/httpd.conf中还有一个443端口的vhost
我删除了conf/httpd.conf中的vhost,并在conf.d/ssl.conf中配置了vhost,现在一切都正常运行了

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

它使用ssl.conf文件生成conf.d文件 我在conf/httpd.conf中还有一个443端口的vhost
我在conf/httpd.conf中删除了vhost,并在conf.d/ssl.conf中配置了vhost,现在一切都正常运行了

当然有两个虚拟主机配置为使用
端口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购买的证书替换该证书。

当然有两个虚拟主机配置为使用
端口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购买的证书替换该证书。

基本上,端口443有2个VHost配置,端口443有2个VHost配置