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。
apache绑定于127.0.1.1?疑惑
-
- 帖子: 2
- 注册时间: 2007-07-23 21:51
-
- 帖子: 2
- 注册时间: 2007-07-23 21:51
-
- 帖子: 16
- 注册时间: 2007-02-06 18:33
----------------------
看一下/etc/hosts 文件里是不是这两个ip地址都登记了。
其实只要是 127.开头的都一样,都是回环地址。你随便访问一个127.* 都访问到的是本机
其实只要是 127.开头的都一样,都是回环地址。你随便访问一个127.* 都访问到的是本机
---------------------------------
http://hi.baidu.com/uroot
http://hi.baidu.com/uroot
-
- 帖子: 305
- 注册时间: 2006-04-13 13:53
Re: apache绑定于127.0.1.1?疑惑
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!
ServerName localhost
Error message disapeared!