Warning: include_once(/www/wwwroot/huison.cn/head.php): failed to open stream: Permission denied in /www/wwwroot/huison.cn/show.php on line 48

Warning: include_once(): Failed opening 'head.php' for inclusion (include_path='.:/www/server/php/56/lib/php') in /www/wwwroot/huison.cn/show.php on line 48

Warning: include_once(/www/wwwroot/huison.cn/banner.php): failed to open stream: Permission denied in /www/wwwroot/huison.cn/show.php on line 53

Warning: include_once(): Failed opening 'banner.php' for inclusion (include_path='.:/www/server/php/56/lib/php') in /www/wwwroot/huison.cn/show.php on line 53

Apache2.4屏蔽IP[段]或某User-Agent访问


在Apache2.4中需要使用Require访问控制指令。使用require指令时,需要在指令外添加<RequireAll></RequireAll>标签对,否则重启Apache2.4加载规则时将出现错误:” negative Require directive has no effect in <RequireAny> directive “。

下面对Require指令的使用进行说明:

<Directory /www/>
        Options FollowSymLinks
        AllowOverride All
        SetEnvIfNoCase User-Agent ^.*Apache-HttpClient.* bad_bot #User-Agent包含Apache-HttpClient的规则
        <RequireAll>
        Require all granted #允许所有
        Require all denied #拒绝所有
        Require not ip 64.64.108.70 #屏蔽IP
        Require not ip 64.64 #屏蔽IP段
        Require not env bad_bot #屏蔽上面设置的规则
        </RequireAll>
</Directory>
其它相关文章:

Warning: include_once(/www/wwwroot/huison.cn/foot.php): failed to open stream: Permission denied in /www/wwwroot/huison.cn/show.php on line 126

Warning: include_once(): Failed opening 'foot.php' for inclusion (include_path='.:/www/server/php/56/lib/php') in /www/wwwroot/huison.cn/show.php on line 126