Chinaunix

标题: apache 虚拟主机问题? [打印本页]

作者: rickyweiwei    时间: 2006-06-12 22:34
标题: apache 虚拟主机问题?
NameVirtualHost 164.70.12.17

<VirtualHost 164.70.12.17>
    ServerAdmin root@aa.com
    DocumentRoot /var/www/virtal/test2.aa.com/html
    ServerName test2.example.com
    ErrorLog logs/test2.aa.com-error-log
    CustomLog logs/test2.aa.com-access_log combined
</VirtualHost>

<VirtualHost 164.70.12.17>
    ServerAdmin root@aa.com
    DocumentRoot /var/www/virtal/test1.aa.com/html
    ServerName test1.example.com
    ErrorLog logs/test1.aa.com-error-log
    CustomLog logs/test1.aa.com-access_log combined
    <Directory "/var/www/virtal/test1.aa.com/html">
    authname "input passwd"
    authtype basic
    authuserfile /etc/httpd/conf/passwd
    require valid-user

    Options Indexes Includes
    </Directory>
</VirtualHost>

在DNS分别作了解析指向不同的虚拟主机,为什么,在客户端访问的时候老出现第一个虚拟主机,即使用输入的是第二个虚拟主机的域名,也得到第一个定义的虚拟主机页面???

是我设定有错吗??

谢谢!!
作者: 小虎牙    时间: 2006-06-13 09:51
dns是否能正常解析你的两个域名呢?
作者: addbe    时间: 2006-06-13 10:08
1、检查apache配置文件是否有语法错误
2、是否重新启动过apache
3、两个目录下的文件是否一样
4、DNS是否正确指向
5、输入IP,然后跟绝对地址看下时候可以正常访问
6、再建立一个apache,新建两个虚拟主机看看是不是有问题(个人遇到过这种情况,有个apache就是有问题,由于不是本人安装,原因不得而知)
。。。。。
多想想,把一些可能性都想到试下,应该可以解决问题,实在不行换个apache就是了^_^




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2