Articles in this section

Unable to access website hosted in Plesk: Server Error 403 Forbidden or Apache default page is shown

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • Unable to access a website example.com hosted in Plesk with the:

    CONFIG_TEXT: Server error 403 forbidden

  • Instead of error the default Apache page can be shown.
  • The following error can be found in /var/www/vhosts/example.com/logs/error_log file:

    CONFIG_TEXT: [core:crit] [pid 17427] (13)Permission denied: [client 203.0.113.2:59648] 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


    CONFIG_TEXT: [core:error] [pid 12030:tid 139785465222912] (13)Permission denied: [client 203.0.13.2:62404] AH00035: access to /index.php denied (filesystem path '/var/www/vhosts/example.com/httpdocs/index.php') because search permissions are missing on a component of the path

  • At the same time, the message below can be registered in /var/log/audit/audit.log:

    CONFIG_TEXT: type=AVC msg=audit(1648797251.665:33554): avc: denied { read } for pid=16032 comm="httpd" name=".htaccess" dev="dm-0" ino=33597071 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=0

Cause

Incorect SELinux context for /var/www/vhosts/example.com/httpdocs directory. 

Resolution

  1. Log into the server to the server via SSH.

  2. Execute the command below to restore the proper SELinux context for the /var/www/vhosts/example.com/httpdocs directory:

    # restorecon -Rv /var/www/vhosts/example.com/httpdocs/

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.