doushi9376 2014-06-20 22:55
浏览 50

在设置zend框架时禁止使用Wamp 403

I am actually trying to install zend framework on WAMP. I followed the instruction on this tutorial. I have encountered a problem. I setup Zend Framework in the directory C:\websites\test. I edited the file C:\wampzend\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf according to the instructions in the tutorial:

<Directory c:/websites>
    Options Indexes FollowSymLinks
    DirectoryIndex index.php
    AllowOverride All
    Order Deny,Allow
    Allow from all
</Directory>
<VirtualHost *:80>
    DocumentRoot "C:/wampzend/www"
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/websites/test/public"
    ServerName test
    SetEnv APPLICATION_ENV "development"
</VirtualHost>

I also edited my hosts file and entered a pointer from test to 127.0.0.1. If I go to the url test I get a 403 Forbidden response. localhost which points to wampzend/www works fine. Any solutions for the 403 response?

  • 写回答

1条回答 默认 最新

  • dqndc26628 2014-06-20 23:23
    关注

    Try this instead, the allocation of directory access rights really belongs inside the ... definition and should be specific to that VHOST.

    <VirtualHost *:80>
        DocumentRoot "C:/wampzend/www"
        ServerName localhost
        <Directory "c:/wampzend/www">
            AllowOverride All
            Order Deny,Allow
            Deny from all
            Allow from 127.0.0.1 localhost ::1
        </Directory>
    </VirtualHost>
    
    <VirtualHost *:80>
        DocumentRoot "C:/websites/test/public"
        ServerName test
        SetEnv APPLICATION_ENV "development"
        <Directory "c:/websites/test/public">
            Options Indexes FollowSymLinks
            DirectoryIndex index.php
            AllowOverride All
            Order Deny,Allow
            Deny from all
            Allow from 127.0.0.1 localhost ::1
        </Directory>
    </VirtualHost>
    

    Using Allow from all is definitely over kill, especially as you are just developing and not giving access to the world. It wont actually give access to the world, unless you port forward your router, but when you try that, its best that only the sites you actually want to be visible to the world are.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题