specially 发表于 2007 年 9 月 29 日 09:42:45

apache 虚拟主机问题

我用的是APACHE 2.24版,比如绑定的域名是www.baidu.com,绑定目录是WWWROOT,通过8080端口访问
于是我修改HTTPD.CONF以下语句:
listen:8080
ServerName www.baidu.com
DocumentRoot "../wwwroot"
在路由映射后调试通过www.baidu.com:8080正常访问

现在我想绑定另外一个域名比如WAP.BAIDU.COM 到WAP目录,通过虚拟主机设置,于是我修改httpd.conf

在最后加入
NameVirtualHost 192.168.0.1
<VirtualHost 192.168.0.1>
ServerName www.baidu.com
DocumentRoot "../wwwroot"
</VirtualHost>
<VirtualHost 192.168.0.1>
ServerName wap.baidu.com
DocumentRoot "../wap"
</VirtualHost>


但是现在就是通过www.baidu.com:8080 和 wap.baidu.com:8080 都只访问得到wwwroot 也就是说两个域名其实都是指向了一个目录我晕了,怎么办?我用的是WIN2003

pengxing 发表于 2007 年 9 月 29 日 09:45:29

重起apache米..

specially 发表于 2007 年 9 月 29 日 09:48:57

重新启动无数次了........
连服务器都启动过滴

specially 发表于 2007 年 9 月 29 日 10:03:13

人呢人呢?:@ :@ :@ :@ :@ :@

pengxing 发表于 2007 年 9 月 29 日 10:07:28

那就不知道了..没弄过服务器..php从来都是在自己机器玩

specially 发表于 2007 年 9 月 29 日 10:31:30

在自己机器上玩?用IIS?

specially 发表于 2007 年 9 月 29 日 10:57:19

顶成水贴:'( :'(

specially 发表于 2007 年 9 月 29 日 11:18:32

顶上,不能解决就不能开空间

ppopcn 发表于 2007 年 9 月 29 日 12:36:13

NameVirtualHost 192.168.0.1:8080
<VirtualHost 192.168.0.1:8080>
    ServerAdmin webmaster@domain.com
    DocumentRoot C:\wwwroot
    ServerName www.baidu.com
</VirtualHost>
<VirtualHost 192.168.0.1:8080>
    ServerAdmin webmaster@domain.com
    DocumentRoot C:\wwwroot
    ServerName baidu.com
</VirtualHost>

<VirtualHost 192.168.0.1:8080>
    ServerAdmin webmaster@domain.com
    DocumentRoot C:\wwwroot\wap
    ServerName wap.baidu.com
</VirtualHost>
<VirtualHost 192.168.0.1:8080>
    ServerAdmin webmaster@domain.com
    DocumentRoot C:\wwwroot\wap
    ServerName www.wap.baidu.com
</VirtualHost>

duwu 发表于 2007 年 9 月 30 日 19:33:52

http://ww.an9.name/tmp/apache2/zh/

还是先看一下手册的好.
页: [1]
查看完整版本: apache 虚拟主机问题