我在 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 解析中被忽略。
- 在 Firefox 地址栏中输入 about:config
- 搜索network.trr.mode偏好名称
- 将值设为5,即选择关闭
- 验证/etc/hosts 是否被使用
- 如果可行,请确定合适的值(0、1、 2、3、4、5) 用于您的设置
关于linux - Firefox 不加载虚拟主机网站而 chrome 加载虚拟主机网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42758992/