【问题标题】:Firefox does not load virtual host website while chrome doesFirefox 不加载虚拟主机网站,而 chrome 加载
【发布时间】:2017-03-13 08:12:58
【问题描述】:

我在 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 中我得到 server not found 错误。我检查了所有 Firefox 文档并在我的机器上重新安装了它,但我没有解决方案。

有什么建议吗?

【问题讨论】:

  • 你检查过 apache 的日志吗?
  • 是的,访问日志和错误日志中没有数据
  • 你试过http://127.0.0.1/webservicemotornet.dev 吗?所以而不是localhost 你把IP
  • 这个问题可能对你有帮助:askubuntu.com/questions/682501/…
  • 对不起,我看到在虚拟主机中我有 morotnetwebservice 而在主机中我有 webservicemotornet。现在可以了。

标签: linux apache ubuntu firefox


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    抱歉,我看到在虚拟主机中我有 morotnetwebservice,而在主机中我有 webservicemotornet。现在可以了!

    【讨论】:

      猜你喜欢
      • 2012-10-05
      • 2017-05-05
      • 2013-05-16
      • 1970-01-01
      • 2016-06-13
      • 1970-01-01
      • 2013-08-09
      • 1970-01-01
      • 2013-07-14
      相关资源
      最近更新 更多