apache绑定于127.0.1.1?疑惑

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
gadfly0217
帖子: 2
注册时间: 2007-07-23 21:51

apache绑定于127.0.1.1?疑惑

#1

帖子 gadfly0217 » 2007-07-23 22:06

apache version 2.2.3

装完后默认配置启动。

由于未连接网络。/etc/init.d/apache2 restart 提示:
“* Forcing reload of web server (apache2)...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName [ OK ]"

/etc/apache2/port.conf 中为"Listen 80",并未指定监听IP地址。应为监听所有有效IP地址。运行ifconfig 只发现lo--127.0.0.1,没有127.0.1.1的IP。

在/var/www/apche2-default/index.html中将"It works"改为“It will work"。
启动Firefox,输入http://localhost,还是It works;在http://127.0.1.1:80下得到It will work。

奇怪的是切换到console,用lynx http://localhost和lynx http://127.0.1.1:80都显示It will work。
头像
aitilang
帖子: 1026
注册时间: 2007-04-28 21:38

#2

帖子 aitilang » 2007-07-23 22:31

ff要清除cache先
gadfly0217
帖子: 2
注册时间: 2007-07-23 21:51

#3

帖子 gadfly0217 » 2007-07-23 22:51

是的,cache清除就正常了。

可为什么会多127.0.1.1?
suave
帖子: 34
注册时间: 2005-09-05 12:09
来自: Peking
联系:

#4

帖子 suave » 2007-07-25 16:03

我的也是这样,奇怪
urooter
帖子: 16
注册时间: 2007-02-06 18:33

----------------------

#5

帖子 urooter » 2007-08-03 0:26

看一下/etc/hosts 文件里是不是这两个ip地址都登记了。
其实只要是 127.开头的都一样,都是回环地址。你随便访问一个127.* 都访问到的是本机
---------------------------------
http://hi.baidu.com/uroot
cn.jihao
帖子: 1
注册时间: 2007-08-15 21:02

#6

帖子 cn.jihao » 2007-08-15 21:03

aitilang 写了:ff要清除cache先
怎么清除,我第一次用ubuntu。谢谢!
kuerbt
帖子: 305
注册时间: 2006-04-13 13:53

Re: apache绑定于127.0.1.1?疑惑

#7

帖子 kuerbt » 2009-06-05 17:22

To get rid of error message, I created an ‘httpd.conf’ file (/etc/apache2/httpd.conf) and filled it with:

ServerName localhost

Error message disapeared!
回复