Question
- How to restore the default permissions for the virtual host?
Answer
Note: solution for Plesk for Windows is available in article #213376469.
Since Plesk Obsidian 18.0.35 it is possible to change file permissions recursively via GUI.
- Log into Plesk
- Go to Plesk > Domains > example.com > File manager
- Click
next to a folder and click Change Permissions.
via command line
-
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.
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