SymptomsIt is necessary to apply an attached hotfix for a server with Parallels Plesk Panel (PP). How do I do it properly?
Resolution1) It is necessary to back up the old file (or files, or folders). The best way to do it is to use the cp command.
#cp -a /usr/local/psa/admin/htdocs/domains/hosting/site_app_pkgs.php /usr/local/psa/admin/htdocs/domains/hosting/site_app_pkgs.php.old
2) Then change the working folder to the place where the hotfix should be applied and download it from there.
Another method is to use the "-P" option of wget to download the file inside a custom folder:
# wget -P /usr/local/psa/admin/htdocs/domains/hosting http://kb.sp.parallels.com/Attachments/12284/Attachments/site_app_pkgs.zip
3) Then unzip the attachment and place it inside of the old file.
# unzip /usr/local/psa/admin/htdocs/domains/hosting/site_app_pkgs.zip -d /usr/local/psa/admin/htdocs/domains/hosting/
If another format is used, for example, tar.gz, it is necessary to use the related tool:
# tar xfz /usr/local/psa/admin/htdocs/domains/hosting/etc_psa.tar.gz -C /usr/local/psa/tmp/1
Here, the content of the tar.gz file will be extracted in the /usr/local/psa/tmp/1 folder.
Note: Sometimes, a target file may be occupied by a running process.
4) Then it is necessary to check and correct the owner and permissions for the new file or folder. This is possible using the stat command and the copy of the old file.
# stat /usr/local/psa/admin/htdocs/domains/hosting/site_app_pkgs.php.old
Size: 26031 Blocks: 56 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 5571708 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 501/ psaadm)
The new file may be modified by the following commands:
#chmod 0644 /usr/local/psa/admin/htdocs/domains/hosting/site_app_pkgs.php
#chown root:psaadm /usr/local/psa/admin/htdocs/domains/hosting/site_app_pkgs.php
5) If necessary, restart the related service.
Here is the method for Apache client service: