Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

pcfg_openfile: unable to check htaccess file

Discussion in 'General Discussion' started by Nirjonadda, Apr 4, 2017.

  1. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    418
    Likes Received:
    10
    Trophy Points:
    18
    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
    
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    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.
     
  3. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    418
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    /public_html/.htaccess permissions is 0644
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    That's the permissions on the .htaccess file. I'm referring to the "public_html" directory itself.

    Thanks!
     
  5. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    418
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Does not work this command but public_html directory Permissions: 0750 viewed via cPanel File Manager.

    Code:
    [root@na ~]# /home/$nadda
    -bash: /home/: Is a directory
    [root@na ~]# /home/$nadda/public_html
    -bash: /home//public_html: No such file or directory
    
     
    #5 Nirjonadda, Apr 4, 2017
    Last edited: Apr 4, 2017
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    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.
     
  7. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    418
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    @cPanelMichael Yes now get work the command. Please let me know this fix.

    Code:
    [root@na ~]# 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: -
    [root@na ~]#
    
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    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.
     
  9. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    418
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    "Enable File Protect" is enabled by default, OK I do run command to correct the permissions.

    Code:
    [root@na ~]# /usr/local/cpanel/scripts/enablefileprotect
    Setting /home permissions to 0711......Done
    Setting permissions for.....nirjonadda …
    nadda …
    nilbashona …
    onabiladda …
    ...Done
    [root@na ~]#
    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
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    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.
     
  11. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    418
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator

    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
    
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  13. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    418
    Likes Received:
    10
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator

    Support Request ID is: 8358285
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page