Symptoms
- Plesk Obsidian running on a Linux-based operating system
- Opening the domain of website hosted on Plesk in a browser returns a 403 Forbidden error
-
Website hosted in Plesk or some sections of it are inaccessible with an error similar to the following in
/var/www/vhosts/example.com/logs/error_log
:AH01071: Got error 'PHP message: PHP Warning: require(/var/www/vhosts/example.com/httpdocs/wp-includes/load.php): failed to open stream: Permission denied in /var/www/vhosts/example.com/httpdocs/wp-settings.php on line 19
PHP message: PHP Fatal error: require(): Failed opening required '/var/www/vhosts/example.com/httpdocs/wp-includes/load.php' (include_path='.:/opt/plesk/php/7.1/share/pear') in /var/www/vhosts/example.com/httpdocs/wp-settings.php on line 19'[crit] [client 203.0.113.2] (13)Permission denied: /var/www/vhosts/example.com/httpdocs/css/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://www.example.com/index.html
Cause
Incorrect permissions or ownership for website files and directories.
Resolution
- Log into Plesk
- Go to Subscriptions > example.com and determine the system user for the Subscription tied to the affected domain:
-
Connect to the server via SSH as the root user
-
Run the following commands:
Note: Replace "johndoe" with the system user name from step #2
# find /var/www/vhosts/example.com/httpdocs/ -type f -exec chmod 644 {} ;
# find /var/www/vhosts/example.com/httpdocs/ -type d -exec chmod 755 {} ;
# find /var/www/vhosts/example.com/httpdocs/ -type f -exec chown johndoe:psacln {} ;
# find /var/www/vhosts/example.com/httpdocs/ -type d -exec chown johndoe:psacln {} ;