试一下这个
<VirtualHost *.aa.com.80>
    ServerAdmin [email protected]
    DocumentRoot /usr/local/apache/www/gdwht/webchange
    ServerName gdwh.guangdongwh.com
    ServerAlias *.guangdongwh.com
</VirtualHost>

解决方案 »

  1.   

    刚刚看了一下自己以前的服务器配置,
    设置如下即可
    <VirtualHost 127.0.0.1>
        DocumentRoot /home/web/se
        ServerName se.aa.com.cn
        ErrorLog /var/log/httpd/error_log
        CustomLog /var/log/httpd/access_log combined
    </VirtualHost>
      

  2.   

    ServerAlias 可以用*.xxxxx这样的写法吗?
    如果你的httpd.conf中只有这两个虚拟主机,你把它们的位置调换一下就可以了。把*.xxxxx的那一个虚拟主机放到最前面,如下:<VirtualHost *.80>
        ServerAdmin [email protected]
        DocumentRoot /usr/local/apache/www/gdwht/webchange
        ServerName gdwh.guangdongwh.com
        ServerAlias *.guangdongwh.com
    </VirtualHost><VirtualHost *.80>
        ServerAdmin [email protected]
        DocumentRoot /usr/local/apache/www/gdwht
        ServerName www.guangdongwh.com
    </VirtualHost>
      

  3.   

    “想把所有的二级域名都指向webchange目录去”??
    不太能理解这个需求的真正含义若多个域名指向同一个目录,那么要多个域名干什么呢?钱花不掉啦?
      

  4.   

    “想把所有的二级域名都指向webchange目录去”??
    --------------------
    目的在于实现自动建站功能,通过这个目录的跳转文件,把它转到其网站目录下面去
      

  5.   

    apache有一个多站点设置参数,“实现自动建站功能”应该利用他
    USER_DIR = /xxxx
    后,所有在/xxxx目录下的一级子目录都可以作为站点使用
    访问格式:http://localhost/~username按照你的域名就是
    http://www.guangdongwh.com/~username按照你的域就是
    http://guangdongwh.com/~username通过url_rewrite可以很方便的重写为
    http;//username.guangdongwh.com描述中的username就是使用“自动建站功能”的用户的注册名
    当apache设置好以后,增加一个用户站点的工作就是建一个目录