解决配置的网站"You don't have permission to access this resource."报错问题

今天用LAMP组合环境配置WEB环境的时候有看到报错"You don't have permission to access this resource."。这个应该是配置文件没有处理好导致的。看似没有权限,但是给权限后还是没有解决问题。

<VirtualHost *:80>
    ServerAdmin webmaster@example.com
    DocumentRoot "/www/wwwroot/lezaiyun.com"
    ServerName tools.lezaiyun.com
    ServerAlias lezaiyun.com
    #errorDocument 404 /404.html
    ErrorLog "/www/wwwlogs/lezaiyun.com-error_log"
    CustomLog "/www/wwwlogs/lezaiyun.com-access_log" combined
    
    #DENY FILES
     <Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>
       Order allow,deny
       Deny from all
    </Files>
    
    #PHP
    <FilesMatch \.php$>
            SetHandler "proxy:unix:/tmp/php-cgi-71.sock|fcgi://localhost"
    </FilesMatch>
    
    #PATH
    <Directory "/www/wwwroot/lezaiyun.com">
        SetOutputFilter DEFLATE
        Options FollowSymLinks #禁止显示Apache目录列表
        AllowOverride All #在AllowOverride 设置为 None 时, .htaccess 文件将被完全忽略。当此指令设置为 All 时,所有具有 ".htaccess" 作用域的指令都允许出现在 .htaccess 文件中。
        Require all granted  #允许所有请求访问资源
        DirectoryIndex index.php index.html index.htm default.php default.html default.htm
    </Directory>
</VirtualHost>

这里我从其他可用的网站复制过来文件,然后对照修改就可以解决。

投上你的一票

本文出处:老蒋部落 » 解决配置的网站"You don't have permission to access this resource."报错问题 | 欢迎分享( 公众号:老蒋朋友圈 )

公众号 「老蒋朋友圈」获取站长新知 / 加QQ群 【1012423279】获取商家优惠推送