MAMP "403 Forbidden You don't have permission to access / on this server."

    用MAMP搭建本地服务器的时候,设置好ip和端口等属性之后,浏览器访问,报 403错误:

 Forbidden  

You don't have permission to access / on this server.

google之后,stackoverflow已有类似的问题:http://stackoverflow.com/questions/10873295/error-message-forbidden-you-dont-have-permission-to-access-on-this-server

主要有以下方法是:

将 /Application/MAMP /conf/ apache/httpd.conf  中的如下部分


<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Allow from all
</Directory>
set the options to : Options Indexes FollowSymLinks Includes ExecCGI


改成:

<Directory />
    #Options FollowSymLinks
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order deny,allow
    Allow from all
</Directory>


也有人提出是访问权限的问题,就是进程的拥有者没有访问Document root的权限,原话如下:

Also, one should check the folder's permissions so that the Apache process' owner has permissions to read/execute the specified path for the virtual host. On Windows this could rarely be a problem but on Linux it can be a more frequent cause of 403.


看到这我才想到原来我将Document root 设在了桌面。而我直接访问Document root,就报错了。如果访问目录下的某个文件就没问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值