Add to Favourites Add to Favourites    Print this Article Print this Article

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

When viewing your domain, if you see the error "Forbidden" and then check your apache logs:

and see the error:

[crit] [client] (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

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.

Was this answer helpful?

Also Read