pcfg_openfile: unable to check htaccess file

Nirjonadda

Well-Known Member
May 8, 2013
752
28
78
cPanel Access Level
Root Administrator
I am getting lot of error log about pcfg_openfile: unable to check htaccess file. I have set htaccess file 0644.

Code:
[Tue Apr 04 15:37:00.125145 2017] [core:crit] [pid 13433] (13)Permission denied: [client 66.228.37.207:33454] AH00529: /home/user/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/user/public_html/' is executable
[Tue Apr 04 15:38:20.418669 2017] [core:crit] [pid 13477] (13)Permission denied: [client 66.228.37.207:33514] AH00529: /home/user/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/user/public_html/' is executable
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

Check the permissions and ownership values on the "/home/$username" and "/home/$username/public_html" directories to ensure they match what's used for other accounts on the server.

If you do not have root access, let us know the permissions on the public_html directory using FTP or File Manager.

Thank you.
 

Nirjonadda

Well-Known Member
May 8, 2013
752
28
78
cPanel Access Level
Root Administrator
Hello,

Check the permissions and ownership values on the "/home/$username" and "/home/$username/public_html" directories to ensure they match what's used for other accounts on the server.

If you do not have root access, let us know the permissions on the public_html directory using FTP or File Manager.

Thank you.
/public_html/.htaccess permissions is 0644
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
That's the permissions on the .htaccess file. I'm referring to the "public_html" directory itself.

Thanks!
 

Nirjonadda

Well-Known Member
May 8, 2013
752
28
78
cPanel Access Level
Root Administrator
That's the permissions on the .htaccess file. I'm referring to the "public_html" directory itself.

Thanks!
Does not work this command but public_html directory Permissions: 0750 viewed via cPanel File Manager.

Code:
[[email protected] ~]# /home/$nadda
-bash: /home/: Is a directory
[[email protected] ~]# /home/$nadda/public_html
-bash: /home//public_html: No such file or directory
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

Those are not actual commands. You'd have to use a command such as:

Code:
stat /home/username/public_html
Thank you.
 

Nirjonadda

Well-Known Member
May 8, 2013
752
28
78
cPanel Access Level
Root Administrator
Hello,

Those are not actual commands. You'd have to use a command such as:

Code:
stat /home/username/public_html
Thank you.
@cPanelMichael Yes now get work the command. Please let me know this fix.

Code:
[[email protected] ~]# stat /home/nadda/public_html
  File: ‘/home/nadda/public_html’
  Size: 4096            Blocks: 16         IO Block: 4096   directory
Device: fd02h/64770d    Inode: 357074      Links: 21
Access: (0750/drwxr-x---)  Uid: ( 1001/   nadda)   Gid: ( 1001/   nadda)
Context: system_u:object_r:httpd_user_content_t:s0
Access: 2016-09-06 05:47:55.482877648 +0600
Modify: 2017-04-04 22:31:09.372692812 +0600
Change: 2017-04-04 22:31:09.372692812 +0600
 Birth: -
[[email protected] ~]#
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

Browse to "WHM >> Tweak Settings" under the "Security" tab and let us know if "Enable File Protect" is enabled. If not, try enabling it, then disabling it again to reset file permissions on the public_html directory to default. If it is enabled, try running the following command to correct the permissions:

Code:
/usr/local/cpanel/scripts/enablefileprotect
Thank you.
 
  • Like
Reactions: Andre Bastos

Nirjonadda

Well-Known Member
May 8, 2013
752
28
78
cPanel Access Level
Root Administrator
Hello,

Browse to "WHM >> Tweak Settings" under the "Security" tab and let us know if "Enable File Protect" is enabled. If not, try enabling it, then disabling it again to reset file permissions on the public_html directory to default. If it is enabled, try running the following command to correct the permissions:

Code:
/usr/local/cpanel/scripts/enablefileprotect
Thank you.
"Enable File Protect" is enabled by default, OK I do run command to correct the permissions.

Code:
[[email protected] ~]# /usr/local/cpanel/scripts/enablefileprotect
Setting /home permissions to 0711......Done
Setting permissions for.....nirjonadda …
nadda …
nilbashona …
onabiladda …
...Done
[[email protected] ~]#
Do have a issue with option Optimize .htaccess (AllowOverride) via WHM Home »Service Configuration »Apache Configuration »Global Configuration? System Default: search_full_path ?


Screenshot_4.png
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Do have a issue with option Optimize .htaccess (AllowOverride) via WHM Home »Service Configuration »Apache Configuration »Global Configuration? System Default: search_full_path ?
That should not result in the error message you reported. Could you confirm if the permissions on the public_html directory were updated?

Thank you.
 

Nirjonadda

Well-Known Member
May 8, 2013
752
28
78
cPanel Access Level
Root Administrator
That should not result in the error message you reported. Could you confirm if the permissions on the public_html directory were updated?

Thank you.

Still are getting the log.

Code:
[Wed Apr 05 22:32:16.376812 2017] [core:crit] [pid 19485] (13)Permission denied: [client 180.97.106.37:19358] AH00529: /home/nilbashona/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/nilbashona/public_html/' is executable
[Wed Apr 05 22:33:55.545890 2017] [core:crit] [pid 20267] (13)Permission denied: [client 180.97.106.37:51419] AH00529: /home/onabiladda/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/onabiladda/public_html/' is executable
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

Feel free to open a support ticket using the link in my signature so we can take a closer look and determine which directory is using the incorrect permissions or ownership values.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

To update, it looks like the issue was not reproducible. One other item to check would be to verify if the system is using Mod_Ruid2 and "EXPERIMENTAL: Jail Apache Virtual Hosts using mod_ruid2 and cPanel® jailshell." is enabled in "WHM >> Tweak Settings"? If so, there's an internal case (CPANEL-10163) that might relate to the issue.

Thank you.