Website is not accessible with 403 Forbidden: AH00529: pcfg_openfile: unable to check htaccess file, ensure it is readable

Created:

2016-11-16 13:08:40 UTC

Modified:

2017-04-24 11:02:24 UTC

3

Was this article helpful?


Have more questions?

Submit a request

Website is not accessible with 403 Forbidden: AH00529: pcfg_openfile: unable to check htaccess file, ensure it is readable

Applicable to:

  • Plesk for Linux

Symptoms

While trying to browse a website, the error 403 Forbidden appears:

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.

The domain's error log /var/www/system/example.com/logs/error_log contains the following:

(13)Permission denied: /var/www/vhosts/example.com/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://example.com/

Or

(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

Apache service does not have proper permissions to vhost or httpdocs folder.

Resolution

For Debian:

  1. Find the username that is used by the Apache service. This username is defined in the APACHE_RUN_USER variable in /etc/apache2/envvars .

  2. Add that user to the psaserv group. For example, if the Apache user is www-data , you would add the user in the psaserv group as below:

    # usermod -a -G psaserv www-data
  3. Restart web server

    # service apache2 restart

For CentOS:

  1. Add the apache user to the psaserv group:
    # usermod -a -G psaserv apache
  2. Restart web server

    # service httpd restart
  3. If the above steps do not help, change folder permissions to 775:

    # chmod 775 /var/www/vhosts/example.com

Finally, check that the domain has the correct ownership. It should look like:

# ls -ld  /var/www/vhosts/example.com
drwx--x--- 5 ftp_user psaserv 4096 Aug 30 08:33 /var/www/vhosts/example.com
# ls -ld /var/www/vhosts/example.com/httpdocs
drwx--x--- 5 ftp_user psaserv 4096 Aug 30 08:33 /var/www/vhosts/example.com/httpdocs

Note : If the server is running on Proxmox VE, this configuration will not work as expected. Please contact Proxmox support for further assistance.

In case, of several domains are affected by the issue, fix ownership for their httpdocs directories:

# /usr/local/psa/bin/repair --restore-vhosts-permissions
Have more questions? Submit a request
Please sign in to leave a comment.