php - SNI 错误 Apache2 日志

标签 php apache ssl apache2 sni

今天我在查看日志时发现了 apache2 中的这个异常。

[ssl:error] [pid 29646] AH02032: Hostname page_not_found provided via SNI and hostname www.site.ltd provided via HTTP are different

由于我对这个主题不是很了解,所以我阅读了一些指南,但我不太了解如何解决它...... 在我的配置中,我有一个默认的虚拟主机。 apache 或 php 上的任何其他文件都是默认的

我读到当你在一个地方有许多具有不同证书的虚拟主机时会出现问题,但这不是我的情况......

我该如何解决这个问题?您可以在下面找到配置!

PHP 5.6.17-3+deb.sury.org~trusty+1 (cli)

服务器版本:Apache/2.4.7 (Ubuntu)

/etc/host 是默认文件

默认-ssl.conf

<VirtualHost *:80>
    ServerName www.site.ltd
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

默认-ssl.conf

<IfModule mod_ssl.c>
    <VirtualHost *:443>
        SSLEngine On
        ServerAdmin webmaster@localhost
        SSLStrictSNIVHostCheck off
        ServerName www.site.ltd
        DocumentRoot /var/www/html

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

        SSLEngine on

        SSLCertificateFile    /etc/apache2/ssl/site.crt
        SSLCertificateKeyFile /etc/apache2/ssl/site.key

        SSLCACertificateFile /etc/apache2/ssl/intermediate_site_ca.crt

        <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
        # MSIE 7 and newer should be able to use keepalive
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

    </VirtualHost>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

最佳答案

看起来是由于来自客户端(可能是机器人)的狡猾请求而不是您的配置有问题:https://serverfault.com/questions/561945/conflict-between-sni-and-http-provided-domains

我想你不会每次请求都得到它吧?如果是这样,请检查当时的请求,然后忽略它(如果你真的想要,也可以阻止该 IP)。

关于php - SNI 错误 Apache2 日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35049882/

相关文章:

php - Mac 上的 Apache、MySql 和 PHP

java - 从独立客户端上传文件

google-app-engine - 在 AppEngine 上设置 SSL...分配的 URL "empty"

ios - 使用 ASIS3 启用 HTTPS

php - 如何在wordpress主题中编辑html代码

php - 提高 PHP MYSQL 查询性能或服务器问题?

PHP 请求 "queueing"

javascript - 刚刚将我的网站移至 SSL,但我的内容不安全

PHP检查字符串是否包含数字并检查字符串长度

php - Laravel 授权中间件 : Class can does not exist