我偶然发现一个错误,我已经将apache httpd配置为充当反向代理的虚拟主机,这是我的虚拟主机:
<VirtualHost *:80>
ServerName example2.com
ErrorDocument 404 /404.html
ErrorDocument 503 /503.html
ErrorDocument 401 /401.html
###redirect permanent####
Redirect permanent / https://example2.com/
</VirtualHost>
<VirtualHost _default_:443>
ServerName example2.com
DocumentRoot /var/www/proxyhost/public_html
ErrorLog /var/log/httpd/proxyhost_ssl_error.log
CustomLog /var/log/httpd/proxyhost_ssl_requests.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
BrowserMatch "MSIE [2-8]" nokeepalive downgrade-1.0 force-response-1.0
RewriteEngine on
RewriteRule ^/test1$ /test1/ [R]
RewriteRule ^/test2$ /test2/ [R]
ProxyPass /test1/ ajp://host1:8009/test/
ProxyPassReverse /test1/ ajp://host1:8009/test/
ProxyPass /test2/ ajp://host2:8009/test2/
ProxyPassReverse /test2/ ajp://host2:8009/test2/
ProxyPreserveHost On
ErrorDocument 404 /404.html
ErrorDocument 503 /503.html
ErrorDocument 401 /401.html
</VirtualHost>
<Directory /var/www/proxyhost/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
问题是,使用上述配置与chrome和firefox等浏览器完美配合。但是,当我尝试使用Win Server 2003上的旧IE 6访问Web时,无法加载该页面。我尝试使用http(注释重定向功能)和https访问,但未显示任何内容。
这是错误日志
[Sun Oct 28 13:23:32.502672 2018] [alias:warn] [pid 22755] AH00671: The Alias directive in /etc/httpd/directory-enabled/DIR_BRI.conf at line 1 will probably never match because it overlaps an earlier Alias.
[Sun Oct 28 13:23:32.502679 2018] [alias:warn] [pid 22755] AH00671: The Alias directive in /etc/httpd/directory-enabled/DIR_BTN.conf at line 1 will probably never match because it overlaps an earlier Alias.
[Sun Oct 28 13:23:32.502685 2018] [alias:warn] [pid 22755] AH00671: The Alias directive in /etc/httpd/directory-enabled/DIR_MANDIRI.conf at line 1 will probably never match because it overlaps an earlier Alias.
[Sun Oct 28 13:23:32.503602 2018] [auth_digest:notice] [pid 22755] AH01757: generating secret for digest authentication ...
[Sun Oct 28 13:23:32.504221 2018] [lbmethod_heartbeat:notice] [pid 22755] AH02282: No slotmem from mod_heartmonitor
[Sun Oct 28 13:23:32.505594 2018] [ssl:warn] [pid 22755] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Oct 28 13:23:32.507996 2018] [mpm_prefork:notice] [pid 22755] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips configured -- resuming normal operations
[Sun Oct 28 13:23:32.508016 2018] [core:notice] [pid 22755] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
有解决问题的建议吗?因为我无权强迫我们的用户升级其操作系统和浏览器。
谢谢,
加利
最佳答案
无论使用哪种浏览器,都需要解决配置错误。 Alias
,No slotmem from mod_heartmonitor
,...
至于SSL错误,您正在使用SNI(Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
)。 IE 6不支持SNI。因此,Apache不知道IE 6用户正在尝试访问哪个站点。
当Apache收到未启用SNI的请求时,它将查看端口(此处为443),并在端口443(配置自上而下)中找到第一个VirtualHost,以处理该请求。因此,IE 6用户将始终获得配置中第一个<VirtualHost *:443>
中标识的证书。
此时,您有2个选择。
不支持IE6。请在您的网站上注明旧版本不能与您的网站一起使用(坦率地说,IE 6太旧了,我知道的所有商业网站都不再支持它)。
将您希望IE 6用户首先看到的默认<VirtualHost *:443>
放入配置中。但是他们将无法达到其他目标。
编辑22:45:如果IE6用户也无法访问您网站的http版本,则可能:
它们根本无法连接,请检查您的Apache日志。您应该将日志置于调试模式(LogLevel debug
)。
他们连接,但是Apache不理解该请求。再次检查Apache日志。
他们收到一个页面,但IE尝试呈现显示时崩溃。这可能是由于IE6太老了才能理解的JavaScript代码引起的。验证浏览器是否收到页面。我不知道您是否可以在IE6中查看某些控制台(我知道最新版本的确有类似功能)。如果Javascript执行失败,您将不会在IE中看到该页面。您可以尝试访问一个非常简单的测试页面。