Articles in this section

Website hosted in Plesk shows 403 Forbidden or blank page: pcfg_openfile: unable to check htaccess file, ensure it is readable

Plesk for Linux kb: technical ABT: Group B

Applicable to:

  • Plesk for Linux

Symptoms

  • Website hosted in Plesk is not working:

    CONFIG_TEXT: You don't have permission to access / on this server.
    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

    Or, a blank page is shown instead of content.

  • Error in Domains > example.com > Logs:

    CONFIG_TEXT: (13)Permission denied: /var/www/vhosts/example.com/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://example.com/
    (13)Permission denied: [client 203.0.113.2:39024] AH00529: /var/www/vhosts/example.com/httpdocs/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/vhosts/example.com/httpdocs/' is executable

Cause

Incorrect permissions on domain files or folders.

Resolution

Repair permissions for the website content:

  1. Login to Plesk

  2. Go to Tools & Settings > Diagnose & Repair

  3. In File System section select Only the Virtual Hosts Files and click Check Selected:mceclip0.png

  4. Click Show Issues when some are detected to view the details:
    mceclip2.png

  5. Click Repair to repair all detected issues for all virtual hosts files.

SSH solution for Plesk Onyx 17.8 and Obsidian
  1. Connect to the server via SSH.

  2. Execute the following command (replacing example.com with the domain name):

    # plesk repair fs example.com

  3. Add required permissions for all the folders inside the document root of the website:

    # find /var/www/vhosts/example.com/httpdocs/ -type d -exec chmod 755 {} \;

  4. Add required permissions for all files inside the document root of the website:

    # find /var/www/vhosts/example.com/httpdocs/ -type f -exec chmod 644 {} \;

  5. Set the proper ownership:

    # chown jdoe:psaserv /var/www/vhosts/example.com

For Plesk Onyx 17.5 and lower
  1. Connect to the server via SSH.

  2. Execute the following command (replace example.com in the command below with the domain name:

    # INFO=($(MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin psa -sN -e'SELECT h.www_root,s.login FROM domains d, hosting h, sys_users s WHERE s.id=h.sys_user_id AND h.dom_id=d.id AND d.name="example.com"')); chown -R ${INFO[1]}:psacln ${INFO[0]}; chown ${INFO[1]}:psaserv ${INFO[0]}

  3. Execute the following command (replacing example.com with the domain name):

    # plesk repair fs example.com

  4. Add executable for all the folders inside the document root of the website:

    # find /var/www/vhosts/example.com/httpdocs/ -type d -exec chmod 755 {} \;

the same symptoms may appear when apache permissions are not correct: https://support.plesk.com/hc/en-us/articles/13302928909847

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.