Applicable to:
- Plesk for Linux
Question
- How to restore the default permissions for the virtual host?
Answer
Note: solution for Plesk for Windows is available in the article #213376469.
-
Connect to the server using SSH.
-
Run the following commands:
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 {} \;
Additional information
The virtual host structure description can be found in the Virtual Host Structure page.
Here are the default permissions for Plesk 12.5 domain:
# ls -la /var/www/vhosts/example.com
total 16
drwx--x--- 4 admin123 psaserv 4096 Jan 5 13:14 .
drwxr-xr-x 13 root root 4096 Jan 5 13:14 ..
drwxr-x--- 6 admin123 psaserv 4096 Jan 5 13:14 httpdocs
drwx------ 2 admin123 root 4096 Jan 5 13:15 logs
# ls -la /var/www/vhosts/system/example.com
total 24
drwx--x--x 6 root psaserv 4096 Jan 5 13:14 .
drwxr-xr-x 7 root root 4096 Jan 5 13:14 ..
drwxr-x--- 2 root psaserv 4096 Jan 5 13:15 conf
drwxr-xr-x 2 root root 4096 Jan 5 13:14 etc
drwx------ 2 psaadm root 4096 Jan 5 13:15 logs
dr-xr-x--- 6 root psaserv 4096 Jan 5 13:14 statistics
Comments
4 comments
Why do some files lose their rights at all? What is or can be a reason?
@F L E X 2 0 0 0 2 1 0 3
Hi!
Usually, this does not occur. In case you use CentOS, consider using audit.
Also, make sure you do not have any malware on the server.
Hi,
In case of "user_example" what would you recommend? not root right?
Also, how to avoid this happening in new installations? We by default use a custom WordPress media uploads folder, as ~/wp-uploads/ kind of sucks (sorry Matt), and this issue always pops out on custom WP folders in brand new installations.
Thanks
@Mario
As my colleague mentioned this does not happen normally. I recommend using audit to monitor permissions changes. Also, if you create custom folders make sure they have 755 permissions.
You can find "user_example" (system user) in Domains > example.com > System user:
Please sign in to leave a comment.