问答详情
源自:2-4 WAMPServer多站点配置

为什么会是这个情况



全部按照视频来的,怎么会这样?http://img.mukewang.com/567181360001466913660736.jpg

提问者:疯马少年 2015-12-16 23:21

个回答

  • 单色彩虹
    2015-12-18 16:41:19
    已采纳

    找到Apache的\conf目录下的httpd.conf文件,打开它,找到下面这两行:
    # Virtual hosts
    #Include conf/extra/httpd-vhosts.conf
    把它改成下面这样:
    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf
    这个你做了没有?

    如果做了:那么按照一下方式去配置

    <VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "F:\wamp\www\blog\public"
    ServerName laravel.ys7.com
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
    </VirtualHost>

    然后,我再稍微问一下,你确定你的www目录没错嘛?是D盘下的DEMO这个目录?

  • 楽冷风清
    2015-12-21 18:21:57

    看阿帕奇官方文档啊,权限的问题 将<Directory />
       AllowOverride None
       Require all denied
    </Directory>里面的 两行代码
    改为<Directory />
       #AllowOverride None
       #Require all denied
    </Directory>


    我的按视频操作也出现这问题,找了半天发现是这里的问题,httpd.conf文件关于DocumentRoot "D:/webdir/"下边的权限需要注释掉,视频只提到了<Directory "D:/webdir/">的权限问题



    DocumentRoot "D:/webdir/"


    #

    # Each directory to which Apache has access can be configured with respect

    # to which services and features are allowed and/or disabled in that

    # directory (and its subdirectories). 

    #

    # First, we configure the "default" to be a very restrictive set of 

    # features.  

    #

    <Directory />

    #    AllowOverride none

    #    Require all denied 

    </Directory>


    #

    # Note that from this point forward you must specifically allow

    # particular features to be enabled - so if something's not working as

    # you might expect, make sure that you have specifically enabled it

    # below.

    #


  • 疯马少年
    2015-12-18 13:24:34

    567397ff00019bc804210169.jpghttp://img.mukewang.com/56739858000117cf07950474.jpg

    567397ff000120c005000299.jpg

    有什么不对的吗?


  • 疯马少年
    2015-12-17 22:28:42

    php.ini?

  • 单色彩虹
    2015-12-17 20:38:11

    1、确定你的端口是80

    2、确定你更改了httpd.conf文件开启了虚拟路径(我描述有点问题,你懂就可以)这个选项

    2.1 我有点忘了,这个文件php.ini 貌似也是要配置的

    3、确定你更改了httpd-vhosts.conf文件设置正确

    4、确定你更改了host文件

    5、确定你重启了wamp(或者其他)所有的服务

    6、确定你重启浏览器(这个其实无所谓,最好重启)

  • lynhao
    2015-12-17 12:52:01

    在localhost后面加个80端口号就可以了