Applicable to:
- Plesk for Linux
Question
How to restore default permissions in virtual host directory on Plesk for Linux?
Answer
Note: solution for Plesk for Windows is available in the article How to restore default permissions on a domain in Plesk for Windows?
- Log into Plesk.
- Go to Domains > example.com > File Manager.
- Clicknext to a directory or a file and click Change Permissions.
- Set the permissions, enable the option Change permissions recursively if necessary, and click Save or Save and resume to apply the changes:
Note: The recommended permissions are 755 for directories (Read, Write, and Execute for owner, Read and Execute for group and others) and 644 for files (Read and Write for owner, Read for group and others).
-
Connect to the server using SSH.
-
Obtain list of subscriptions along with their system user names:
# plesk db "select name, login from domains join hosting on domains.id=hosting.dom_id join sys_users on hosting.sys_user_id=sys_users.id"
-
Run the following commands with replacing example.com with the real subscription name and user_example with the system user of the subscription found in step 2:
Note: substitute example.com with the real subscription name and user_example with the system user of the subscription.
# 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 user_example:psacln {} \;
# find /var/www/vhosts/example.com/httpdocs/ -type d -exec chown user_example:psacln {} \;
Comments
0 comments
Please sign in to leave a comment.