免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 10059 | 回复: 5
打印 上一主题 下一主题

[FreeBSD] httpd启动后 无法 连接127.0.0.1:80 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-06 17:09 |只看该作者 |倒序浏览
在FreeBSD下,没有通过ports 方式安装,自己down了一个http-2.2.4. 安装,安装目录是/usr/local/http2.2.4
现 http 可以启动, 用ps -ax 查看进程
有 五个进程显示  httpd在运行   觉得应该安装成功了
但用web浏览器 接入127.0.0.1时 页面显示:无法载入127.0.0.1 (端口 80)

这是什么原因 ?请教  高手


[ 本帖最后由 水龙头456 于 2007-7-7 14:00 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2007-07-07 08:10 |只看该作者

机器上的 信息

我的机器上是双网卡,一些信息如下 哪位高手帮我看看是什么原因吧????:

bash-2.05b# /usr/local/httpd2.2.4/bin/apachectl status
Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/server-status
bash-2.05b# netstat -an
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp4       0      0  *.80                   *.*                    LISTEN
tcp6       0      0  *.80                   *.*                    LISTEN
Active UNIX domain sockets
Address  Type   Recv-Q Send-Q    Inode     Conn     Refs  Nextref Addr
c20824ec stream      0      0        0 c20381a4        0        0 /tmp/ksocket-root/klauncherGMhGZc.slave-socket
c20381a4 stream      0      0        0 c20824ec        0        0
c1e8bb7c stream      0      0        0 c2038118        0      
0 /tmp/fam-root/fam-
c2038118 stream      0      0        0 c1e8bb7c        0        0
c1e8b460 stream      0      0        0 c2038e38        0        0 /tmp/.ICE-unix/dcop569-1183771069
bash-2.05b# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            202.204.53.1       UGS         0        0    rl1
202.204.53         link#2             UC          0        0    rl1
202.204.53.1       link#2             UHLW        2        0    rl1
202.204.54         link#1             UC          0        0    rl0

Internet6:
Destination                       Gateway                       Flags      Netif            Expire
fe80::%rl0/64                     link#1                        UC          rl0
fe80::2e0:4cff:fe76:2a81%rl0      00:e0:4c:76:2a:81             UHL         lo0
fe80::%rl1/64                     link#2                        UC          rl1
fe80::20d:61ff:fe9c:3d2d%rl1      00:0d:61:9c:3d:2d             UHL         lo0
ff02::%rl0/32                     link#1                        UC          rl0
ff02::%rl1/32                     link#2                        UC          rl1
bash-2.05b# route add -host 127.0.0.1 0.0.0.0 255.0.0.0 -ifp lo0
route: writing to routing socket: Network is unreachable
add net 127.0.0.1: gateway 0.0.0.0: Network is unreachable

ps -ax
1340  ??  Ss     0:00.06 /usr/local/httpd2.2.4//bin/httpd -k start
1341  ??  I      0:00.00 /usr/local/httpd2.2.4//bin/httpd -k start
1342  ??  I      0:00.00 /usr/local/httpd2.2.4//bin/httpd -k start
1343  ??  I      0:00.00 /usr/local/httpd2.2.4//bin/httpd -k start
1344  ??  I      0:00.00 /usr/local/httpd2.2.4//bin/httpd -k start
1345  ??  I      0:00.00 /usr/local/httpd2.2.4//bin/httpd -k start

bash-2.05b# route add -net 127.0.0.0 0.0.0.0 255.0.0.0 -ifp lo0
route: writing to routing socket: Network is unreachable
add net 127.0.0.0: gateway 0.0.0.0: Network is unreachable
bash-2.05b# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
ping: sendto: Can't assign requested address
ping: sendto: Can't assign requested address
ping: sendto: Can't assign requested address
ping: sendto: Can't assign requested address
^C
--- 127.0.0.1 ping statistics ---
4 packets transmitted, 0 packets received, 100% packet loss

[ 本帖最后由 水龙头456 于 2007-7-7 14:13 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2007-07-08 19:14 |只看该作者

问题已经解决了

问题已经解决了^_^

论坛徽章:
0
4 [报告]
发表于 2007-07-09 10:56 |只看该作者
呵呵,你是如何解决的啊。讲来听听啊。我想了解下。。谢了!

论坛徽章:
0
5 [报告]
发表于 2007-07-10 08:18 |只看该作者

回复 #4 lirongtao 的帖子

我的问题是:没有到127.0.0.1 环路接口的路由,所以 本机器虽打开了apache,发往apache服务器的数据包也不能正确传送,也就不能载入网页。
我的解决办法是:
在/etc/rc.conf  内 添加了
network_interface="rl0 rl1 lo0"(网页无法载入时  :network_interface="rl0 rl1")
ifconfig_lo0="inet 127.0.0.1"   (网页无法载入时:ifconfig_lo0=dhcp)
这样就有到127.0.0.1的路由了

论坛徽章:
0
6 [报告]
发表于 2007-07-15 23:42 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP