免费注册 查看新帖 |

Chinaunix

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

[Web] AS4下多域名虚拟主机问题?请教大家! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-05-22 23:02 |只看该作者 |倒序浏览
我的配置文件如下:
NameVirtualHost 192.168.1.66:80
<VirtualHost www.test1.com>
ServerName www.test1.com.cn
ServerAdmin root@test1.com
DocumentRoot "/usr/local/virtual"
DirectoryIndex index.html
ErrorLog logs/web1/error_log
CustomLog logs/web1/access_log combined
</VirtualHost>

<VirtualHost www.test2.com>
ServerName www.test2.com
ServerAdmin root@test2.com
DocumentRoot "/usr/www/web1"
DirectoryIndex index.html
ErrorLog logs/web2/error_log
CustomLog logs/web2/access_log combined
</VirtualHost>

服务起动报错
启动 httpd:[Tue May 22 23:29:49 2007] [error] (EAI 3)Temporary failure in name resolution: Cannot resolve host name www.test1.com --- ignoring!
[Tue May 22 23:29:49 2007] [error] (EAI 3)Temporary failure in name resolution: Cannot resolve host name www.test2.com --- ignoring!
[Tue May 22 23:29:49 2007] [warn] NameVirtualHost 192.168.1.66:80 has no VirtualHosts
[  确定  ]

请问一个各位大侠是什么问题啊?

[ 本帖最后由 god_and_dog 于 2007-5-22 23:23 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2007-05-23 01:02 |只看该作者
这样试试:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.test1.com.cn
ServerAdmin root@test1.com
DocumentRoot /usr/local/virtual
DirectoryIndex index.html
ErrorLog logs/web1/error_log
CustomLog logs/web1/access_log combined
</VirtualHost>

<VirtualHost *:80>
ServerName www.test2.com
ServerAdmin root@test2.com
DocumentRoot /usr/www/web1
DirectoryIndex index.html
ErrorLog logs/web2/error_log
CustomLog logs/web2/access_log combined
</VirtualHost>

论坛徽章:
0
3 [报告]
发表于 2007-05-23 10:29 |只看该作者
原帖由 frank533 于 2007-5-23 01:02 发表于 2楼  
这样试试:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.test1.com.cn
ServerAdmin root@test1.com
DocumentRoot /usr/local/virtual
DirectoryIndex index.html
ErrorLog logs/ ...


高解!支持

论坛徽章:
0
4 [报告]
发表于 2007-05-23 20:17 |只看该作者

回复 #2 frank533 的帖子

非常感觉,这样还真行!
可为何指定IP就不行呢,是ip地址不能和名字帮定,内部没有可解析的DNS吗

论坛徽章:
0
5 [报告]
发表于 2007-06-05 17:58 |只看该作者
我曾经配置和你的一样开始也遇到同样的问题。这应该属于基于域名的虚拟主机。
我认为应该在dns在配置两个域名的相关 A 记录。当然它们属于不同的域,应该在不同的配置文件中。同时客端还要支持http1.1.
我是新手请大家指正。

论坛徽章:
0
6 [报告]
发表于 2007-06-10 18:04 |只看该作者
] [warn] NameVirtualHost 192.168.1.66:80 has no VirtualHosts
估计你的apache监听的不是这个ip的80.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP