【问题标题】:Apache2 Multiple SSL certificates with subdomains won't work带有子域的 Apache2 多个 SSL 证书将不起作用
【发布时间】:2017-10-12 23:39:55
【问题描述】:

我有一个带有 2 个连接域的 Apache 2 服务器。我使用 Let's Encrypt 的证书。然而,我的问题是,只有第一个域的证书有效(1.webpage.com)。然而,SSL 适用于这两个域。 这是我的配置文件

<IfModule mod_ssl.c>
<VirtualHost *:443>

    ServerName 1.webpage.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www
    SSLEngine on
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    #Include conf-available/serve-cgi-bin.conf
    SSLCertificateFile /etc/letsencrypt/live/1.webpage.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/1.webpage.com/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

<VirtualHost *:443>
    ServerName 2.webpage.com
    DocumentRoot /var/www/2

    SSLCertificateFile /etc/letsencrypt/live/2.webpage.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/2.webpage.com/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

干杯

【问题讨论】:

  • 如果现在有效(根据您删除的答案判断),您可以删除您的问题。

标签: apache ssl encryption debian


【解决方案1】:

尝试添加NameVirtualHost 指令。

NameVirtualHost *:443
<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName 1.webpage.com
    ...
</VirtualHost>

【讨论】:

    猜你喜欢
    • 2012-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-04
    • 1970-01-01
    • 2018-09-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多