apache - 可以通过 IE 访问 Apache 虚拟主机,但不能通过 Firefox 或 Chrome
问题描述
设置 WAMPserver 后,我的 Apache localhost 站点在 IE、Chrome 和 Firefox 上正确加载。但是,在创建虚拟主机(在本例中为bssb.dev)后,Chrome 和 Firefox 无法检索页面(错误如下所示)。但是,IE 成功加载。即使在创建虚拟主机之后,所有三个浏览器仍然可以成功加载 localhost。
Chrome Error: This site can’t be reached. bssb.dev refused to connect
Firefox Error: Unable to connect. Firefox can’t establish a connection to the server at bssb.dev.
应该注意的是,两者都在失败时重定向到https://bssb.dev
我在下面粘贴了 Apache 虚拟主机和系统 HOSTS 文件以供参考。任何指导将不胜感激。
Apache httpd-vhosts.conf
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName bssb.dev
DocumentRoot "c:/users/ian/documents/mywebprojects/bssb"
<Directory "c:/users/ian/documents/mywebprojects/bssb/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
#
<VirtualHost *:443>
ServerName bssb.dev
DocumentRoot "c:/users/ian/documents/mywebprojects/bssb"
<Directory "c:/users/ian/documents/mywebprojects/bssb/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
系统主机文件
#
127.0.0.1 localhost
::1 localhost
127.0.0.1 bssb.dev
::1 bssb.dev
其他详情:
OS: Windows 8.1 (unfortunately)
Firefox v60.0.2 (64-bit)
Chrome v66.0.3359.181 (Official Build) (64-bit)
IE v11.0.9600.19003
WAMPsever v3.1.3 (64-bit)
解决方案
没有明确端口号的 HTTPS 表示端口 443。为端口 443 添加虚拟主机。
推荐阅读
- html - 我无法清除错误!请任何人整理一下
- spring - Spring Data JPA:如何获取特定类型的所有实体以及每个实体的关联实体?
- java - Spring Boot 损坏字体
- bash - 比较 2 个字符串
- javascript - 无法在下拉列表中选择货币
- php - 如何在自定义操作中调试““无法获取非对象的属性。”?
- javascript - 当用户使用 JavaScript 和 HTML5 Web Workers 处于非活动状态时触发 AJAX 请求
- css - TranslateZ 不给我任何结果
- makefile - 获取已定义变量的值
- ios - Detox:如何使用 detox 在通知中心点击 iOS 推送通知