Thứ Ba, 18 tháng 2, 2020

How to restore default permissions on a domain in Plesk for Windows?

Question

How to restore default permissions on a domain in Plesk for Windows?

Answer

When default permissions on the domain folder are lost, the following actions can be performed to restore them:
For Plesk 12.5 and Onyx:
C:\> "%plesk_cli%\repair.exe" --repair-webspace-security -webspace-name example.com
If it is necessary to repair permissions for all domains, the following command should be used:
C:\> "%plesk_cli%\repair.exe" --repair-all-webspaces-security
Also, Plesk Reconfigurator could be used: in the Windows Start menu, select All Programs > Plesk > Plesk Reconfigurator and select Repair Plesk installation > Plesk Virtual Hosts Security > Check .
For Plesk before 12.5:
Go to the Domains page, mark the required domains, and click on the Check permissions button. Then uncheck the Check-only mode checkbox and click OK .

How to restore default permissions in the virtual host directory on Linux?


Question

  • How to restore the default permissions for the virtual host?
  • Some files and directories under the domain virtual host directory have lost their permissions. Several are owned by the apache and root users.
  • Uploading files via the File Manager or an FTP client fails:
    Unable to open the directory: Unable to find the directory /var/www/vhosts/example.com/httpdocs/dir/: filemng failed: filemng: opendir failed: Permission denied System error 13: Permission denied
  • The backup task fails with the following message:
    /bin/tar: httpdocs/path/to/a/file: Cannot open: Permission denied
    /bin/tar: httpdocs/path/to/a/file: Cannot stat: Permission denied

Answer

  1. Connect to the server using SSH.
  2. Run the following commands:
    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 {} \;
    Note: substitute example.com with the real subscription name and user_example with the system user of the subscription.

Share This!


Không có nhận xét nào:

Đăng nhận xét