(13)Permission denied: /home/username/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » Apache Related Information

(13)Permission denied: /home/username/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readableLast Modified: Apr 8, 2011, 4:22 pm
When viewing your domain, if you see the error "Forbidden" and then check your apache logs:
/var/log/httpd/error_log
/var/log/httpd/domains/domain.com.error.log

and see the error:

[crit] [client 1.2.3.4] (13)Permission denied: /home/username/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

it would imply that apache does not have read access on your /home/username directory.

The cause for this can be permission related, config related or ownership related.

Apache runs as user "apache", thus the directory must be +x for that user or group.

1) As of DirectAdmin 1.38.0, we implement the secure_acccess_group feature, which will set the /home/user (for Users) to chmod 750 and chown username:access.   The apache user will be in the "access" group.  To confirm this, type the following:

[root@server]# grep ^access: /etc/group
access:x:506:apache,nobody,mail,majordomo,daemon

and you should get something similar to the output shown.

If you get a blank list of Users, then the access group exists, but is empty.   To correctly fill the group (on RedHat/CentOS/Debian systems), type:

usermod -G access apache
usermod -G access nobody
usermod -G access mail
usermod -G access majordomo
usermod -G access daemon

on FreeBSD systems, the command to create the group is:

pw groupadd -n access -M apache,nobody,mail,majordomo,daemon

but this implies the group doesn't yet exist.  This case has not been seen on FreeBSD, so likely won't be needed.

2) The error has also been reported for Users who use mod_ruid.  Ensure that all 4 virtual_host2*.conf files have the mod_ruid code set.   Referenced thread from the forum.
 
Related Helpfiles
Testing which uid php is running as to debug read/write issues

2003 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST