Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache通配符SSL配置以及同一域的组织SSL_Apache_Ssl_Wildcard Subdomain_Apache2.2 - Fatal编程技术网

Apache通配符SSL配置以及同一域的组织SSL

Apache通配符SSL配置以及同一域的组织SSL,apache,ssl,wildcard-subdomain,apache2.2,Apache,Ssl,Wildcard Subdomain,Apache2.2,我设置SSL证书的经验有限,到目前为止,我已经能够在不同的服务器上使用单个SSL证书,现在我一直在尝试在同一域的现有组织SSL旁边设置通配符SSL证书,它一直指向组织证书,即使我在虚拟主机中指定了通配符证书 我将尝试使用示例数据尽我所能解释: 组织证书site.example.com 通配符证书*.example.com apache 2.2.3版 我将省略端口80的东西,因为那里没有问题 配置示例: NameVirtualHost *:443 NameVirtualHost 192.0.2

我设置SSL证书的经验有限,到目前为止,我已经能够在不同的服务器上使用单个SSL证书,现在我一直在尝试在同一域的现有组织SSL旁边设置通配符SSL证书,它一直指向组织证书,即使我在虚拟主机中指定了通配符证书

我将尝试使用示例数据尽我所能解释:

  • 组织证书
    site.example.com
  • 通配符证书
    *.example.com
apache 2.2.3版

我将省略端口80的东西,因为那里没有问题

配置示例:

NameVirtualHost *:443
NameVirtualHost 192.0.2.201:443
NameVirtualHost 192.0.2.202:443

<VirtualHost 192.0.2.202:443>
    ServerName site.example.com
    DocumentRoot /var/www/html/site

    SSLEngine On
    SSLCertificateFile /locationof/organisational.crt
    SSLCertificateChainFile /locationof/organisational.intermediate.pem
    SSLCertificateKeyFile /locationof/organisational.key
</VirtualHost>

<VirtualHost 192.0.2.202:443>
    ServerName  mytestsite.example.com
    DocumentRoot /var/www/html/mytestsite

    SSLEngine On
    SSLCertificateFile /locationof/wildcard.crt
    SSLCertificateChainFile /locationof/wildcard.intermediate.pem
    SSLCertificateKeyFile /locationof/wildcard.key
</VirtualHost>
我检查了
*:443
路径,以防出现重定向或类似情况,但没有。我在示例配置中添加了额外的NameVirtualHost设置。从上面的信息来看,我仍然不确定出了什么问题!通配符SSL证书设置在其他两台服务器上,可以正常工作,但它是这些服务器上唯一的SSL证书,而此服务器上有两个其他服务器和一个共享同一域

编辑2 下面的
中包含了一个ssl.conf文件,但您不认为这会造成任何危害吗


使用.201和.202上的两个证书,此服务器工作正常,而通配符证书在其他两个服务器上工作正常,我只是无法使通配符ssl证书与.202组织证书一起工作:(

在Apache 2.3之前,Apache的哪个版本?您需要一个
NameVirtualHost
指令,否则同一IP上的HTTPS主机将无法工作(这将像您观察到的那样工作,这与您想要的不一样)是的,我在文件中设置了名称virtualhost,apache版本为2.2,我已更新了问题以包含此信息。请尝试
apachectl
测试配置,并
httpd-S
查看virtualhost的转储。请确保重新阅读并检查所有证书路径是否确实对应于正确的证书。apachectl configtest显示语法正常,已经用httpd-S结果更新了上面的问题,我认为所有这些看起来都很好!仍然无法解释是什么导致了问题
192.0.2..201:443       is a NameVirtualHost
         default server www.anothersite.net (/etc/httpd/conf/httpd.conf:aaaa)
         port 443 namevhost www.anothersite.net (/etc/httpd/conf/httpd.conf:aaaa)

192.0.2.202:443       is a NameVirtualHost
         default server site.example.com (/etc/httpd/conf/httpd.conf:xxxx)
         port 443 namevhost site.example.com (/etc/httpd/conf/httpd.conf:xxxx)
         port 443 namevhost mytestsite.example.com (/etc/httpd/conf/httpd.conf:yyyy)

                 wild alias *.*
*:443                  is a NameVirtualHost
         default server someoldsite.com (/etc/httpd/conf.d/ssl.conf:xx)
         port 443 namevhost someoldsite.com (/etc/httpd/conf.d/ssl.conf:xx)
         // there is no virtual host for this old site, it seems it is the name of the server inside /etc/hosts file