AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 520430
Accepted
dotancohen
dotancohen
Asked: 2013-07-03 22:43:12 +0800 CST2013-07-03 22:43:12 +0800 CST 2013-07-03 22:43:12 +0800 CST

子域上的 SSL

  • 772

我正在尝试配置通配符 SSL 证书以服务于子域以及服务器的主域。为了使 SSL 证书正常工作,我似乎必须这样定义主站点的可用站点文件:

<VirtualHost *:443>

当我尝试使用时<VirtualHost someSite.com:443>,Firefox 会抱怨:

An error occurred during a connection to www.someSite.com.

SSL received a record that exceeded the maximum permissible length.
(Error code: ssl_error_rx_record_too_long)
The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.

谷歌浏览器不太具体:

SSL connection error

我可以改变什么,<VirtualHost *:443>以便我可以将 sub.someSite.com 作为具有 SSL 的不同虚拟主机提供服务?

这是在带有 Apache 2.2.22 和 Godaddy SSL 证书的 Ubuntu Server 12.04 LTS(3.2 内核)上。

编辑: : 这是域的 Apache 站点启用文件。

<IfModule mod_ssl.c>
#<VirtualHost *:443>           # With this line, the site serves fine
<VirtualHost someSite.com:443> # With this line, browsers throw the error
        DocumentRoot /var/www/someSite/public_html

        ServerName someSite.com
        ServerAlias www.someSite.com

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/someSite/public_html/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

        SSLEngine on
        SSLCertificateFile    /etc/apache2/ssl/someSite.com.crt
        SSLCertificateKeyFile /etc/apache2/ssl/someSite.key

        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>

        BrowserMatch "MSIE [2-6]" \
                nokeepalive ssl-unclean-shutdown \
                downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

</VirtualHost>
</IfModule>
apache-2.2
  • 1 1 个回答
  • 414 Views

1 个回答

  • Voted
  1. Best Answer
    Michael Hampton
    2013-07-04T09:07:14+08:002013-07-04T09:07:14+08:00

    出于多种原因, Apache 建议不要<VirtualHost>在指令中使用主机名。

    最佳实践是在and指令中指定虚拟主机的 IP 地址或*in和主机名。<VirtualHost>ServerNameServerAlias

    所以要解决这个问题:

    • 如果您希望现有虚拟主机为所有通配符子域提供服务,请添加ServerAlias *.example.com到它。
    • 如果您希望所有通配符子域都由完全不同的虚拟主机提供服务,请添加一个<VirtualHost>带有ServerName something.example.comand的新块ServerAlias *.example.com。
    • 2

相关问题

  • Apache Django Mod_Wsgi - 自动重新加载应用程序

  • Apache:对多个虚拟主机使用相同的目录指令

  • Apache 上的子域不工作 - 找不到服务器

  • PHP 作为 CGI 还是 Apache 模块?

  • 避免将某些丢失的文件记录到 Apache2 错误日志中

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve