解决方案 »

  1.   

    不用,百度搜索关键字 ‘Apache配置虚拟主机’ 去找方法。
      

  2.   

    apache 文件下,有个vhost例子
    <VirtualHost *:80>
    ServerName www.terrify.com
    DocumentRoot "G:\www\apache2.2\htdocs\terrify"  //terrify是指向的项目目录
    </VirtualHost>
      

  3.   


    127.0.0.2   www.terrify.com  host文件需要加上这样么。但是这样,我访问www.terrify.com  为什么是  it works
      

  4.   

    hosts需要加的。参考这里吧: http://www.cnblogs.com/catprayer/archive/2010/10/30/1865308.html
      

  5.   


    版主,我看了还是不行,我的设置如下,www目录下分别安装了php ,apache和mysql。 在host文件中,127.0.0.2 域名只向  www.terrify.com  
    然后比如我把YII框架安装在G:/workSpace/terrify/  这个目录下。
    apache下 http-vhosts.conf  配置如下  :
    <VirtualHost 127.0.0.2:80>
    ServerName www.terrify.com
    DocumentRoot "G:/workSpace/terrify" 
    DirectoryIndex index.html  index.htm index.php
    </VirtualHost>
    为什么yii框架安装好以后,访问www.terrify.com   依旧是it works 
      

  6.   

    httpd.conf 中搜索‘vhost’ 找到下行看是否打开了vhost。
    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf  http-vhosts.conf 中下行是否打开了:
    NameVirtualHost *:80
      

  7.   


    http.conf里
    # Virtual hosts
    #Include conf/extra/httpd-vhosts.confhttp-vhosts.conf 
    NameVirtualHost *:80
    我觉得是不是http.conf设置documentRoot的原因
      

  8.   

    #Include conf/extra/httpd-vhosts.conf   去掉前面的#号,改完保存后重启一下Apache。
      

  9.   

    <VirtualHost 127.0.0.2:80>
    ServerName www.terrify.com
    DocumentRoot "G:/workSpace/terrify" 
    <Directory "G:/workSpace/terrify">
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
    </Directory>
    DirectoryIndex index.html  index.htm index.php
    </VirtualHost>这样呢? 每次改完记得重启Apache再试。
      

  10.   

    Index of /
    • shop/
    我想地址栏输入www.terrify.com 。能直接访问网站
    进入之后报date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. 
    这个好像是时间问题,改了也不行
      

  11.   

    你的 php 是第一次使用吗?这个错误是没有设置时区的原因
    令 php.ini 中
    date.timezone = PRC也可在程序里执行
    date_default_timezone_set('PRC');
    比较麻烦,如无特殊需要,还是在 php.ini 中设置较好。一劳永逸
      

  12.   


    不是第一次使用,而是配置了yii框架要虚拟主机,搞得惨了 PRC也没用
      

  13.   

    Apache重启了没有?
    那就
    date.timezone = Asia/Shanghai
      

  14.   

    怎么不管用啊,你是怎么做的? 改的php.ini 是正确加载的php.ini 吗?
      

  15.   

    把shop目录加进去就是了。
    DocumentRoot "G:/workSpace/terrify/shop"