NameVirtualHost *
这个在头部添加试试。

解决方案 »

  1.   

    哦,对了,你貌似找错文件了,看看其他include进去的conf文件,httpd-vhosts.conf里有没有
      

  2.   

    我在pache2.2\conf\extra文件夹里找到httpd-vhosts.conf ,修改后重启apache还是提示那个错误
    是不是httpd-vhosts的模块未定义? 
      

  3.   

    我用的是帝国CMS的一键安装PHP环境,apache是自动就调好的,修改的话要自己手动慢慢改
    因为一些问题不能重新安装PHP,APACHE,MYSQL,所以调起来很麻烦,配置估计都不和你的一样
    谢谢你的热心解答   httpd.conf文件挺大的 你看下吧http://202.173.255.24/http.txt
      我分不多,不好意思
      

  4.   

    #LoadModule vhost_alias_module modules/mod_vhost_alias.so
    这是虚拟主机的模块,要打开
    # Include conf/extra/httpd-vhosts.conf
    这是虚拟主机的配置文件,你看的教程太老了,新版的配置文件都分开了井号都去掉,虚拟主机设置写在conf/extra/httpd-vhosts.conf里面就行了
      

  5.   

    #LoadModule vhost_alias_module modules/mod_vhost_alias.so 
    # Include conf/extra/httpd-vhosts.conf 
    LS你好,我看了在http.conf里没有这两行,我去掉#号自己添加了,保存后重启apache
    还是提示那个错误,貌似模块没有加载成功
      

  6.   

    谢谢两位的回答,已经没报错了,只是还有点小问题
    服务器上有两个网站,输入第二个网址还是会跳到第一个站上,呵呵 
    NameVirtualHost *:80#
    # VirtualHost example:
    # Almost any Apache directive may go into a VirtualHost container.
    # The first VirtualHost section is used for all requests that do not
    # match a ServerName or ServerAlias in any <VirtualHost> block.
    #
    <VirtualHost *:80>
        ServerAdmin [email protected]
            DocumentRoot D:/EmpireServer/web
            ServerName gamesdiy.com
            ServerAlias www.gamesdiy.com
            ScriptAlias /cgi-bin/ /export/home/dns0755/cgi-bin/
            ErrorLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755-err.log 604800"
            CustomLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755.log 604800" combined
    </VirtualHost><VirtualHost *:80>
         ServerAdmin [email protected]
            DocumentRoot D:/EmpireServer/web/www
            ServerName game123gogogo.com
            ServerAlias www.game123gogogo.com
            ScriptAlias /cgi-bin/ /export/home/dns0755/cgi-bin/
            ErrorLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755-err.log 604800"
            CustomLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755.log 604800" combined
    </VirtualHost>
      

  7.   

    这是我在httpd-vhosts.conf 文件里的设置  麻烦大大再帮我看下是哪里出错了
    怎么第二站的域名总跳到第一个站的内容上
      

  8.   

    这两行都是在你给的http://202.173.255.24/http.txt里面看到的
    修改这种设置后要重启apache
      

  9.   

    嗯  我照你的方法做了  重启apache后没有报错
    不过网站域名设置貌似有点问题,两个网站不管输入那个网址都是进入第一个网站
    麻烦你帮我看下是不是这里设置错误了,我是照网上的方法改的 conf/extra/httpd-vhosts.conf文件:
    NameVirtualHost *:80 # 
    # VirtualHost example: 
    # Almost any Apache directive may go into a VirtualHost container. 
    # The first VirtualHost section is used for all requests that do not 
    # match a ServerName or ServerAlias in any <VirtualHost> block. 

    <VirtualHost *:80> 
        ServerAdmin [email protected] 
            DocumentRoot D:/EmpireServer/web 
            ServerName gamesdiy.com 
            ServerAlias www.gamesdiy.com 
            ScriptAlias /cgi-bin/ /export/home/dns0755/cgi-bin/ 
            ErrorLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755-err.log 604800" 
            CustomLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755.log 604800" combined 
    </VirtualHost> <VirtualHost *:80> 
        ServerAdmin [email protected] 
            DocumentRoot D:/EmpireServer/web/www 
            ServerName game123gogogo.com 
            ServerAlias www.game123gogogo.com 
            ScriptAlias /cgi-bin/ /export/home/dns0755/cgi-bin/ 
            ErrorLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755-err.log 604800" 
            CustomLog "| /usr/local/sbin/rotatelogs /var/log/http/dns0755.log 604800" combined 
    </VirtualHost>