Localhost和127.0.0.1在Web浏览器中显示不同的内容 [英] Localhost and 127.0.0.1 show different content in web browser

查看:544
本文介绍了Localhost和127.0.0.1在Web浏览器中显示不同的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在网络浏览器中输入 127.0.0.1 时,它会按预期显示/var/www/index.php 页,但是当我输入 localhost时会显示"一个简单的hello世界"的html页面,我在计算机上找不到该页面.

When I enter 127.0.0.1 to web browser, it shows page /var/www/index.php as I expected, but when I enter localhost it shows "a simple hello world" html page which I cannot find in the computer.

我使用了find,grep和其他类似工具,但是没有运气.

I used find, grep and other similar tools, but no luck.

您能告诉我为什么本地主机在Web浏览器中显示除127.0.0.1之外的其他内容吗?

Can you please tell me why localhost shows another content then 127.0.0.1 in the web browser?

我在ubuntu 14.04上安装了 apache,mysql和php ,并且 Document Root 设置为/var/www/.以前安装了apache,postgresql和php(已删除),也许我应该检查一些旧的配置文件?

I have installed apache, mysql and php on my ubuntu 14.04 and Document Root is set to /var/www/. There were previously installed apache, postgresql and php (which I removed), maybe should I check some old exist config files?

/etc/hosts 设置为

127.0.0.1    localhost

推荐答案

我只需要按 F5 按钮即可刷新Web浏览器中的本地主机页面.

I only needed to press F5 button in order to refresh the localhost page in my web browser.

现在内容相同.

这篇关于Localhost和127.0.0.1在Web浏览器中显示不同的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆