LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 643|回复: 2

请教各位大侠一个关于apache虚拟主机的问题

[复制链接]
发表于 2005-6-19 11:18:26 | 显示全部楼层 |阅读模式
:help

我使用基于名称的虚拟主机,希望实现以下功能。
当我在浏览器中输入peter.cnshanghaidb1.sg.cn时候显示页面为
/http/index.htm里的内容。

我在httpd.conf 里的配置为(以下配置使用httpd -t 测试语法通过)

NameVirtualHost 10.86.26.65
<VirtualHost 10.86.26.65 >
ServerAdmin root@cnshanghaidb1.sg.cn
DocumentRoot /http
    ServerName peter.cnshanghaidb1.sg.cn
</VirtualHost>

目录的权限为
drwxrwxrwx    2 root     root         4096 Jun 18 18:30 http

index.htm 的权限为
-rwxr-xr-x    1 root     root           24 Jun 18 18:30 index.htm

我已将firewall 关闭。
service iptables status
Firewall is stopped.

我的 /etc/resolv.conf 内容为
search cnshanghaidb1.sg.cn
nameserver 10.86.26.5
nameserver 10.152.31.203
nameserver 159.151.120.40
nameserver 159.151.248.37

但是当我在浏览器中输入peter.cnshanghaidb1.sg.cn 的地址,系统报连接peter.cnshanghaidb1.sg.cn 超时

请各位给我些提示!
谢谢

:thank
发表于 2005-6-19 11:22:44 | 显示全部楼层
检查一下DNS,是DNS没有解析好
或者在hosts文件详细定义peter.cnshanghaidb1.sg.cn   xxx.xxx.xxx.xxx
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-6-19 12:27:58 | 显示全部楼层
我在/etc/hosts 中加入如下行
10.86.26.65     peter.cnshanghaidb1.sg.cn

当我使用 ping peter.cnshanghaidb1.sg.cn
得到如下结果
PING peter.cnshanghaidb1.sg.cn (10.86.26.65) 56(84) bytes of data.
64 bytes from peter.cnshanghaidb1.sg.cn (10.86.26.65): icmp_seq=0 ttl=0 time=0.s
64 bytes from peter.cnshanghaidb1.sg.cn (10.86.26.65): icmp_seq=1 ttl=0 time=0.s
64 bytes from peter.cnshanghaidb1.sg.cn (10.86.26.65): icmp_seq=2 ttl=0 time=0.s

但是问题还以一样的
请问还有那里不对?

谢谢。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表