Firefox没有加载虚拟主机网站

时间:2017-03-13 08:12:59

标签: 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文档并在我的机器上重新安装它,但我没有解决方案。

有什么建议吗?

2 个答案:

答案 0 :(得分:0)

抱歉,我在virtualhost中看到我有morotnetwebservice,而在主机中我有webservicemotornet。现在它有效!

答案 1 :(得分:0)

如果您的网站位于HTTPS上,则mozilla的Trusted Recursive Resolver版本的Firefox 62及更高版本的Firefox可能会导致/ etc / hosts在DNS解析方面被忽略。

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