Permission Denied: /Var/Www/Abc/.Htaccess Pcfg_Openfile: Unable to Check Htaccess File, Ensure It Is Readable

Permission denied: /var/www/abc/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable?

Make sure that the htaccess file is readable by apache:

chmod 644 /var/www/abc/.htaccess 

And make sure the directory it's in is readable and executable:

chmod 755 /var/www/abc/

Apache Permission denied for /srv/www: unable to check .htaccess file but not for /var/www

I finally got to the bottom of the problem. It's caused by SELinux policies overriding basic traditional discretionary access control (DAC) methods such as file permissions or access control lists (ACLs) normally used to control the file access of users!

$ sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted

$ setenforce
usage: setenforce [ Enforcing | Permissive | 1 | 0 ]

$ setenforce Permissive

$ sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted

More info on SELinux at Centos. As soon as I switched to Permissive mode my /srv/ started working.

If you know what and why you are doing this then you can permanently disable SELinux in /etc/selinux/config by changing the following line:

SELINUX=enforcing

to

SELINUX=disabled

Restart your server and you should have it disabled permanently.

Note: When switching from Disabled to either Permissive or Enforcing
mode, it is highly recommended that the system be rebooted and the
filesystem relabeled.

CakePHP permission problems

In fact the error message is giving you all the information:

[…] ensure [.htaccess] is readable and that '/home/vtecnet/public_html/admin/app/webroot/' is executable

I don’t know which version of CakePHP an old cake app is, since you’re not telling us, but looking at file permissions and chmod should point you in the right direction.

WordPress has a nice article on permissions: https://book.cakephp.org/1.3/en/The-Manual/Developing-with-CakePHP/Installation-Preparation.html#permissions

Something like this could help you out, if you have shell access to the server:

# set the ownership to the webserver user (i. e. www-data)
chown -R <insert_webserver_user_here> /home/vtecnet/public_html/admin/
# set permissions recursively
chmod -R 755 /home/vtecnet/public_html/admin/

error in .htacces file

After installation of mod rewrite restart your services then to check if mod rewrite is enabled and used add this in your .htaccess file:

RewriteEngine On
RewriteRule ^.*$ mod_rewrite.php

Then create file mod_rewrite.php and add this and run it

<?php echo "Success"; ?>

If is not enabled open httpd.conf (Apache Config file) and look for this line, remove #, save the file and reload apache again.

#LoadModule rewrite_module modules/mod_rewrite.so

Laravel 5.2 - Getting 500 error when connecting with CSRF disabled

Errors says what is your problem: Permission denied: AH00529: /var/www/api.example.com/web/api/public/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

Make htaccess readable using chmod command:

chmod 644 /var/www/api.example.com/web/api/public/.htaccess

Also check this answers if this not help

Apache doesn't have access to web root directory

So, it seems that I've solved the problem. Apache looked for htaccess file in the parent directories of the web root and didn't have access to read in that directory. So I've added this directory to group _www and gave for it read permissions. It helped me. May be the solution is not the best, but it helps.



Related Topics



Leave a reply



Submit