linux - Firefox 不加载虚拟主机网站而 chrome 加载虚拟主机网站

标签 linux apache ubuntu firefox

我在 linux ubuntu 上为 apache2 网站创建了虚拟主机:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName motornetwebservice.dev
    DocumentRoot /var/www/Motornet/webservice/
    <Directory />
            Options FollowSymLinks
            AllowOverride All
    </Directory>
    <Directory /var/www/Motornet/webservice/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride All
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/motornetwserror.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/motornetwsaccess.log combined
</VirtualHost>

我在 etc/hosts 中设置了这个值:

127.0.0.1   webservicemotornet.dev

然后重新启动 apache。

网站在 chrome 中正确加载,但在 firefox 中我得到服务器未找到错误。我检查了所有 firefox 文档并在我的机器上重新安装了它,但我没有找到解决方案。

有什么建议吗?

最佳答案

如果您的网站使用 HTTPS,从 Firefox 版本 62 及更高版本 Trusted Recursive Resolver mozilla 的程序可能会导致/etc/hosts 在 DNS 解析中被忽略。

  1. 在 Firefox 地址栏中输入 about:config
  2. 搜索network.trr.mode偏好名称
  3. 将值设为5,即选择关闭
  4. 验证/etc/hosts 是否被使用
  5. 如果可行,请确定合适的值(0、1、 2、3、4、5) 用于您的设置

关于linux - Firefox 不加载虚拟主机网站而 chrome 加载虚拟主机网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42758992/

相关文章:

php - 如何在Linux服务器使用率最低(繁忙)的情况下用PHP备份一个巨大的mysql数据库?

linux - 找不到/xampp/lang.php

java - 将 APR 与 Tomcat 一起使用有什么好处(如果有)?

macos - BSD grep "?"GNU 通配符替代方案

linux - 每天在特定时间执行一个shell脚本

linux - 要求使用 grep 命令的作业,当 find 命令没问题时,我该如何编写命令?

node.js - Node js错误: listen EADDRNOTAVAIL 52. **.**.***:1122

python - 安装 pygame ubuntu 时遇到问题

apache - 在 Apache 服务器中使用 vue js SPA 刷新页面时如何修复 "Not found "?

php session - 这对服务器来说会不会太多了?