AH01630: client denied by server configuration .htaccess

血红的双手。 提交于 2021-02-11 13:50:22

问题


I'm having this error, and i can't solve it. I type

tail -f /usr/local/apache/logs/error_log

on cpanel terminal and I receive the following error:

[authz_core:error] [pid 10250]

here's my .htaccess code:

<IfModule authz_core_module>
    Require all granted
</IfModule>
<IfModule !authz_core_module>
    Require all denied
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

I'm not being able to open php files in my vps server(hostgator Apache 2.4.41), instead of opening the file, it is downloaded.


回答1:


This isworking for me, edit it to your requirements

</VirtualHost>
<Directory /var/www/html/example.com/public_html>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule>

Client denied by server configuration

This error means that the access to the directory on the file system was denied by an Apache configuration.

Before you start

Before attempting to alter any existing config file, please take note of the full file system path for which access is being denied, and the IP or hostname of the client:

[<date here>] [error] [client ::1] client denied by server configuration: /var/www/example.com/

Using the correct path in the directory block for the following examples is essential to solving this problem. In this case, a client from the local machine (::1) is being denied access to [/var/www/example.com][1] .

Something like this should resolve your problem :

<Directory /var/www/example.com>
  Order allow,deny
  Allow from all
</Directory>

Or this one

<Directory /var/www/example.com>
  Order allow,deny
  Allow from all
  Require all granted
</Directory>

For more explanition:

https://cwiki.apache.org/confluence/display/httpd/ClientDeniedByServerConfiguration



来源:https://stackoverflow.com/questions/59638429/ah01630-client-denied-by-server-configuration-htaccess

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!