XAMPP Apache有多个SSL主机问题

时间:2015-07-06 14:33:07

标签: php apache ssl

我正在尝试为同一本地服务器上的两个独立站点运行两个SSL主机。

它适用于一个

HTTP-ssl.conf中

<VirtualHost *:443>
 ServerName drupal.local
 DocumentRoot C:\xampp\htdocs\drupal\code\drupal
 SSLEngine on
 SSLCertificateFile C:\xampp\apache\conf\ssl.crt\server.crt
 SSLCertificateKeyFile C:\xampp\apache\conf\ssl.key\server.key
</VirtualHost>

然而,当我添加另一台主机时,我在apache错误日志中收到以下错误

[Mon Jul 06 15:26:19.768431 2015] [ssl:warn] [pid 10672:tid 260] AH01909: anchor.local:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jul 06 15:26:19.768431 2015] [ssl:warn] [pid 10672:tid 260] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jul 06 15:26:19.818431 2015] [core:warn] [pid 10672:tid 260] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Jul 06 15:26:19.978431 2015] [ssl:warn] [pid 10672:tid 260] AH01909: anchor.local:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jul 06 15:26:19.978431 2015] [ssl:warn] [pid 10672:tid 260] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jul 06 15:26:20.008431 2015] [mpm_winnt:notice] [pid 10672:tid 260] AH00455: Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.6.8 configured -- resuming normal operations
[Mon Jul 06 15:26:20.008431 2015] [mpm_winnt:notice] [pid 10672:tid 260] AH00456: Apache Lounge VC11 Server built: Jan 28 2015 16:48:40
[Mon Jul 06 15:26:20.008431 2015] [core:notice] [pid 10672:tid 260] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Mon Jul 06 15:26:20.018431 2015] [mpm_winnt:notice] [pid 10672:tid 260] AH00418: Parent: Created child process 7984
[Mon Jul 06 15:26:20.728431 2015] [ssl:warn] [pid 7984:tid 272] AH01909: anchor.local:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jul 06 15:26:20.728431 2015] [ssl:warn] [pid 7984:tid 272] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jul 06 15:26:20.938431 2015] [ssl:warn] [pid 7984:tid 272] AH01909: anchor.local:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jul 06 15:26:20.938431 2015] [ssl:warn] [pid 7984:tid 272] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Jul 06 15:26:20.968431 2015] [mpm_winnt:notice] [pid 7984:tid 272] AH00354: Child: Starting 150 worker threads.

触发错误的配置看起来像

<VirtualHost *:443>
 ServerName anchor.local
 DocumentRoot C:\xampp\htdocs\anchor-2.6.4\code\drupal
 SSLEngine on
 SSLCertificateFile C:\xampp\apache\conf\ssl.crt\server.crt
 SSLCertificateKeyFile C:\xampp\apache\conf\ssl.key\server.key
</VirtualHost>

<VirtualHost *:443>
 ServerName test.local
 DocumentRoot C:\xampp\htdocs\code\
 SSLEngine on
 SSLCertificateFile C:\xampp\apache\conf\ssl.crt\server.crt
 SSLCertificateKeyFile C:\xampp\apache\conf\ssl.key\server.key
 </VirtualHost>

我已经尝试在不同的端口上运行SSL,但到目前为止还没有。

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

您需要确保服务器ID和SSL ID相同。