Symptoms
-
Cannot create a file or directory under some specific domain folder, e.g.
error_docs
due to the following warning:Warning: Add a file to: /error_docs
This directory is read-only: you can not create files or directories in it. -
The following error appears in an attempt to modify files inside the `error_docs` folder:
Server Error 500 PleskUtilException
filemng failed: file: error occurred during /bin/mkdir command
Cause
Incorrect permissions or/and ownership on the affected folder.
Resolution
-
Connect to the server via SSH.
-
Execute the following command below to fix permissions and ownership automatically. Mind replacing the
example.com
domain name in the command below with the affected one:# plesk repair fs example.com
It may be required to fix permissions/ownership manually. For this follow the steps below:
Manual solution
-
Connect to the server via SSH.
-
Execute the command below to obtain the
example.com
's system user. In the example below it is johndoe:# plesk db -N -e "select login from sys_users where home like '%example.com%' and mapped_to is NULL"
johndoe -
Set the correct permissions or/and ownership to the affected folder:
# chown johndoe:psacln /var/www/vhosts/example.com/error_docs
# chmod 755 /var/www/vhosts/example.com/error_docs