{"id":926,"date":"2016-11-28T07:23:16","date_gmt":"2016-11-28T03:53:16","guid":{"rendered":"http:\/\/webide.ir\/blog\/?p=926"},"modified":"2016-11-28T07:23:16","modified_gmt":"2016-11-28T03:53:16","slug":"%d8%ae%d9%88%d8%af%da%a9%d8%a7%d8%b1%d8%b3%d8%a7%d8%b2%db%8c-%d9%86%d8%b5%d8%a8-%d9%88%d8%b1%d8%af%d9%be%d8%b1%d8%b3-%d8%a8%d8%a7-%d9%be%d9%84%d8%b3%da%a9","status":"publish","type":"post","link":"https:\/\/webide.ir\/blog\/%d8%ae%d9%88%d8%af%da%a9%d8%a7%d8%b1%d8%b3%d8%a7%d8%b2%db%8c-%d9%86%d8%b5%d8%a8-%d9%88%d8%b1%d8%af%d9%be%d8%b1%d8%b3-%d8%a8%d8%a7-%d9%be%d9%84%d8%b3%da%a9","title":{"rendered":"\u062e\u0648\u062f\u06a9\u0627\u0631\u0633\u0627\u0632\u06cc \u0646\u0635\u0628 \u0648\u0631\u062f\u067e\u0631\u0633 \u0628\u0627 \u067e\u0644\u0633\u06a9"},"content":{"rendered":"<p style=\"text-align: justify\">\u0628\u06cc \u0634\u06a9 \u0634\u0645\u0627 \u0646\u06cc\u0632 \u062f\u0631 \u0645\u0648\u0631\u062f \u0646\u062d\u0648\u0647 \u0646\u0635\u0628 \u0633\u0631\u06cc\u0639 \u0648\u0631\u062f\u067e\u0631\u0633 \u0628\u0627 \u067e\u0644\u0633\u06a9 \u0627\u0637\u0644\u0627\u0639\u0627\u062a\u06cc \u062f\u0627\u0631\u06cc\u062f.\u00a0 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0645\u062a\u062e\u0635\u0635 \u0647\u0627\u0633\u062a\u06cc\u0646\u06af\u060c \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u06cc\u0646 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0631\u0627 \u062f\u0631 \u0627\u062e\u062a\u06cc\u0627\u0631 \u0645\u0634\u062a\u0631\u06cc\u0627\u0646 \u062e\u0648\u062f \u0646\u06cc\u0632 \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f.\u062f\u0631 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0642\u0635\u062f \u062f\u0627\u0631\u06cc\u0645 \u062e\u0648\u062f\u06a9\u0627\u0631\u0633\u0627\u0632\u06cc \u0646\u0635\u0628 \u0648\u0631\u062f\u067e\u0631\u0633 \u062f\u0631 \u067e\u0644\u0633\u06a9 \u0631\u0627 \u0628\u0627 \u0647\u0645 \u0645\u0631\u0648\u0631 \u06a9\u0646\u06cc\u0645. \u067e\u0633 \u0647\u0645\u0631\u0627\u0647 \u0648\u0628 \u0627\u06cc\u062f\u0647 \u0628\u0627\u0634\u06cc\u062f.<\/p>\n<p style=\"text-align: justify\"><!--more--><\/p>\n<p style=\"text-align: justify\">\u00a0 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0686\u0646\u062f \u06a9\u0644\u06cc\u06a9 \u0633\u0627\u062f\u0647 \u0627\u0645\u06a9\u0627\u0646 \u0646\u0635\u0628 \u0648\u0631\u062f\u067e\u0631\u0633 \u0641\u0631\u0627\u0647\u0645 \u0645\u06cc \u0634\u0648\u062f:<\/p>\n<ol style=\"text-align: justify\">\n<li>\u0628\u0631 \u0631\u0648\u06cc \u06af\u0632\u06cc\u0646\u0647 \u0648\u0631\u062f\u067e\u0631\u0633(WordPress) \u062f\u0631 \u0645\u0646\u0648\u06cc Featured applications \u06a9\u0644\u06cc\u06a9 \u06a9\u0646\u06cc\u062f.<\/li>\n<\/ol>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-927\" src=\"http:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/1.png\" alt=\"1\" width=\"259\" height=\"264\" srcset=\"https:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/1.png 259w, https:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/1-55x55.png 55w\" sizes=\"auto, (max-width: 259px) 100vw, 259px\" \/><\/p>\n<ol style=\"text-align: justify\" start=\"2\">\n<li>\u0631\u0648\u06cc \u06af\u0632\u06cc\u0646\u0647 \u0646\u0635\u0628(install) \u06a9\u0644\u06cc\u06a9 \u0646\u0645\u0627\u06cc\u06cc\u062f.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-928\" src=\"http:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/2.png\" alt=\"2\" width=\"875\" height=\"345\" srcset=\"https:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/2.png 875w, https:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/2-300x118.png 300w, https:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/2-768x303.png 768w\" sizes=\"auto, (max-width: 875px) 100vw, 875px\" \/><\/p>\n<p style=\"text-align: justify\">\u0647\u0645\u0627\u0646\u0637\u0648\u0631 \u06a9\u0647 \u0645\u0634\u0627\u0647\u062f\u0647 \u06a9\u0631\u062f\u06cc\u062f \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u062a\u0646\u0647\u0627 \u0628\u0627 \u0686\u0646\u062f \u06a9\u0644\u06cc\u06a9 \u0633\u0627\u062f\u0647 \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc \u0634\u0648\u062f. \u0627\u0645\u0627 \u0627\u06af\u0631 \u0628\u062e\u0648\u0627\u0647\u06cc\u062f \u0627\u06cc\u0646 \u0641\u0631\u0622\u06cc\u0646\u062f \u0631\u0627 \u062e\u0648\u062f\u06a9\u0627\u0631 \u06a9\u0646\u06cc\u062f \u0628\u0627\u06cc\u062f \u0628\u0647 \u0641\u06a9\u0631 \u0631\u0648\u0634 \u062f\u06cc\u06af\u0631\u06cc \u0628\u0627\u0634\u06cc\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0642\u0635\u062f \u062f\u0627\u0631\u06cc\u0645 \u0628\u0647 \u0647\u0645\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u0628\u067e\u0631\u062f\u0627\u0632\u06cc\u0645. \u0641\u0642\u0637 \u0628\u0647 \u062e\u0627\u0637\u0631 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u06a9\u0647 \u0627\u06cc\u0646 \u0634\u06cc\u0648\u0647 \u062f\u0631 \u067e\u0644\u0633\u06a9 12.5 \u062a\u0633\u062a \u0634\u062f\u0647 \u0627\u0633\u062a \u0627\u0645\u0627 \u0628\u0627 Plesk Onyx \u0646\u06cc\u0632 \u0633\u0627\u0632\u06af\u0627\u0631 \u0627\u0633\u062a.<\/p>\n<p style=\"text-align: justify\"><strong>\u0686\u06af\u0648\u0646\u0647 \u0646\u0635\u0628 \u0648\u0631\u062f\u067e\u0631\u0633 \u0628\u0631\u0627\u06cc \u062f\u0627\u0645\u0646\u0647 \u0647\u0627\u06cc \u062c\u062f\u06cc\u062f \u0631\u0627 \u062e\u0648\u062f\u06a9\u0627\u0631 \u0633\u0627\u0632\u06cc\u0645\u061f<\/strong><\/p>\n<p style=\"text-align: justify\">\u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u062f\u0627\u0645\u0646\u0647 \u062c\u062f\u06cc\u062f \u062a\u0648\u0633\u0637 \u067e\u0644\u0633\u06a9 \u0641\u0631\u0627\u0647\u0645 \u0645\u06cc \u0634\u0648\u062f \u0628\u0627\u06cc\u062f \u06cc\u06a9 \u0645\u062d\u0631\u06a9 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u0645. \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u06cc\u06a9 \u0645\u062d\u0631\u06a9 \u0627\u0632 \u06a9\u0646\u062a\u0631\u0644 \u06a9\u0646\u0646\u062f\u0647 \u0631\u0648\u06cc\u062f\u0627\u062f(event handler) \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u0645. (<a href=\"http:\/\/docs.plesk.com\/en-US\/12.5\/administrator-guide\/server-administration\/event-tracking\/event-parameters-passed-by-event-handlers.67897\/#o67985\">\u0627\u06cc\u0646 \u067e\u0633\u062a<\/a> \u0631\u0627 \u0645\u0634\u0627\u0647\u062f\u0647 \u06a9\u0646\u06cc\u062f). \u062f\u0631 \u067e\u0627\u0631\u0627\u0645\u062a\u0631\u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u06a9\u0646\u062a\u0631\u0644 \u06a9\u0646\u0646\u062f\u0647 \u0631\u0648\u06cc\u062f\u0627\u062f\u00a0 \u0628\u0627\u06cc\u062f \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a\u06cc \u0642\u0631\u0627\u0631 \u062f\u0627\u062f\u0647 \u0634\u0648\u062f. \u0627\u06cc\u0646 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0628\u0627 permission \u0631\u0648\u062a \u0627\u062c\u0631\u0627 \u0645\u06cc \u0634\u0648\u062f. \u062e\u0648\u0628 \u0641\u0631\u0636 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0646\u0627\u0645 \u0627\u0633\u06a9\u0631\u067e\u06cc\u062a domain-created.sh \u0627\u0633\u062a:<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-930\" src=\"http:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/4-768x289.png\" alt=\"4-768x289\" width=\"625\" height=\"235\" srcset=\"https:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/4-768x289.png 768w, https:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/4-768x289-300x113.png 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p style=\"text-align: justify\">\u00a0\u062f\u0631 \u06cc\u06a9 \u0633\u0646\u0627\u0631\u06cc\u0648\u06cc \u0639\u0645\u0648\u0645\u06cc \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0646\u062e\u0648\u0627\u0647\u06cc\u0645\u00a0 \u0648\u0631\u062f\u067e\u0631\u0633 \u0631\u0627 \u062f\u0631 \u0647\u0631 \u062f\u0627\u0645\u0646\u0647 \u062c\u062f\u06cc\u062f \u0628\u0647 \u06a9\u0627\u0631 \u0628\u0628\u0646\u062f\u06cc\u0645. \u00a0\u0633\u0627\u062f\u0647 \u062a\u0631\u06cc\u0646 \u0631\u0648\u0634 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u06a9\u0647 \u0628\u062a\u0648\u0627\u0646\u06cc\u0645 \u062a\u0639\u06cc\u06cc\u0646 \u06a9\u0646\u06cc\u0645 \u0686\u0647 \u062f\u0627\u0645\u0646\u0647 \u0627\u06cc \u0628\u0647 \u0648\u0631\u062f\u067e\u0631\u0633 \u0646\u06cc\u0627\u0632 \u062f\u0627\u0631\u062f \u061b \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u0645 \u062f\u0648 \u067e\u0644\u0646 \u062c\u062f\u0627\u06af\u0627\u0646\u0647 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u0645.\u00a0 \u0641\u0631\u0636 \u06a9\u0646\u06cc\u062f \u062f\u0627\u0645\u0646\u0647 \u0627\u06cc \u06a9\u0647 \u0648\u0631\u062f\u067e\u0631\u0633 \u062f\u0631 \u0622\u0646 \u0641\u0639\u0627\u0644 \u0627\u0633\u062a\u060c WordPress auto \u00a0\u0646\u0627\u0645 \u062f\u0627\u0631\u062f. \u0634\u0645\u0627 \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u0631\u0627 \u0645\u062d\u062f\u0648\u062f \u06a9\u0646\u06cc\u062f \u0632\u06cc\u0631\u0627 \u00a0\u0645\u0639\u0645\u0648\u0644\u0627 \u0628\u0647 \u0628\u06cc\u0634 \u0627\u0632 \u06cc\u06a9 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u0646\u06cc\u0627\u0632 \u0646\u062e\u0648\u0627\u0647\u06cc\u062f \u062f\u0627\u0634\u062a.<\/p>\n<p style=\"text-align: justify\">\u062e\u0648\u0628 \u062d\u0627\u0644\u0627 \u0627\u062c\u0627\u0632\u0647 \u062f\u0647\u06cc\u062f \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0645\u0648\u0631\u062f \u0646\u0638\u0631 \u0631\u0627 \u0628\u0627 \u0647\u0645 \u0645\u0648\u0631\u062f \u0628\u0631\u0631\u0633\u06cc \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u0645. \u0641\u0642\u0637 \u0628\u0647 \u062e\u0627\u0637\u0631 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u06a9\u0647 \u0627\u06af\u0631\u0686\u0647 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0632\u06cc\u0631 \u062a\u0633\u062a \u0634\u062f\u0647 \u0648 \u06a9\u0627\u0631\u0627\u06cc\u06cc \u0622\u0646 \u0645\u0648\u0631\u062f \u062a\u0627\u06cc\u06cc\u062f \u0627\u0633\u062a \u0627\u0645\u0627 \u0646\u0645\u06cc \u062a\u0648\u0627\u0646 \u0645\u0637\u0645\u0626\u0646 \u0628\u0648\u062f \u06a9\u0647 \u062f\u0631 \u0633\u0631\u0648\u0631 \u0648 \u0633\u06cc\u0633\u062a\u0645\u00a0 \u0639\u0627\u0645\u0644 \u0647\u0627\u06cc \u062f\u06cc\u06af\u0631 \u0647\u0645\u06cc\u0646 \u06a9\u0627\u0631\u0627\u06cc\u06cc \u0631\u0627 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f. \u0628\u0647 \u0647\u0645\u06cc\u0646 \u062e\u0627\u0637\u0631 \u0628\u062f\u0648\u0646 \u062a\u0633\u062a\u060c \u0622\u0646\u0627\u0644\u06cc\u0632 \u0648 \u0628\u0631\u0631\u0633\u06cc \u0634\u0631\u0627\u06cc\u0637 \u0646\u0645\u06cc \u062a\u0648\u0627\u0646 \u0627\u0632 \u0622\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f.\u00a0 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0645\u062b\u0627\u0644 \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0631\u062f\u0646 \u067e\u0633\u0648\u0631\u062f \u0628\u0647 \u0634\u06a9\u0644 \u0622\u0634\u06a9\u0627\u0631(plaintext) \u062f\u0631 \u0641\u0627\u06cc\u0644 \u06a9\u0646\u062a\u0631\u0644 \u06a9\u0646\u0646\u062f\u0647 \u0645\u06cc \u062a\u0648\u0627\u0646\u062f \u062f\u0631\u062f\u0633\u0631\u0633\u0627\u0632 \u0628\u0627\u0634\u062f.<\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/p>\n<p>2<\/p>\n<p>3<\/p>\n<p>4<\/p>\n<p>5<\/p>\n<p>6<\/p>\n<p>7<\/p>\n<p>8<\/p>\n<p>9<\/p>\n<p>10<\/p>\n<p>11<\/p>\n<p>12<\/p>\n<p>13<\/p>\n<p>14<\/p>\n<p>15<\/p>\n<p>16<\/p>\n<p>17<\/p>\n<p>18<\/p>\n<p>19<\/p>\n<p>20<\/p>\n<p>21<\/p>\n<p>22<\/p>\n<p>23<\/p>\n<p>24<\/p>\n<p>25<\/p>\n<p>26<\/p>\n<p>27<\/p>\n<p>28<\/p>\n<p>29<\/p>\n<p>30<\/p>\n<p>31<\/p>\n<p>32<\/p>\n<p>33<\/p>\n<p>34<\/p>\n<p>35<\/p>\n<p>36<\/p>\n<p>37<\/p>\n<p>38<\/p>\n<p>39<\/p>\n<p>40<\/p>\n<p>41<\/p>\n<p>42<\/p>\n<p>43<\/p>\n<p>44<\/p>\n<p>45<\/p>\n<p>46<\/p>\n<p>47<\/p>\n<p>48<\/p>\n<p>49<\/p>\n<p>50<\/p>\n<p>51<\/p>\n<p>52<\/p>\n<p>53<\/p>\n<p>54<\/p>\n<p>55<\/p>\n<p>56<\/p>\n<p>57<\/p>\n<p>58<\/p>\n<p>59<\/p>\n<p>60<\/p>\n<p>61<\/p>\n<p>62<\/p>\n<p>63<\/p>\n<p>64<\/p>\n<p>65<\/p>\n<p>66<\/p>\n<p>67<\/p>\n<p>68<\/p>\n<p>69<\/p>\n<p>70<\/p>\n<p>71<\/p>\n<p>72<\/p>\n<p>73<\/p>\n<p>74<\/p>\n<p>75<\/p>\n<p>76<\/p>\n<p>77<\/p>\n<p>78<\/p>\n<p>79<\/p>\n<p>80<\/p>\n<p>81<\/p>\n<p>82<\/p>\n<p>83<\/p>\n<p>84<\/p>\n<p>85<\/p>\n<p>86<\/p>\n<p>87<\/p>\n<p>88<\/p>\n<p>89<\/p>\n<p>90<\/p>\n<p>91<\/p>\n<p>92<\/p>\n<p>93<\/p>\n<p>94<\/p>\n<p>95<\/p>\n<p>96<\/p>\n<p>97<\/p>\n<p>98<\/p>\n<p>99<\/p>\n<p>100<\/p>\n<p>101<\/p>\n<p>102<\/p>\n<p>103<\/p>\n<p>104<\/p>\n<p>105<\/p>\n<p>106<\/p>\n<p>107<\/p>\n<p>108<\/p>\n<p>109<\/p>\n<p>110<\/p>\n<p>111<\/p>\n<p>112<\/p>\n<p>113<\/td>\n<td width=\"1800\">\n<p style=\"text-align: left\">\/bin\/date &gt;&gt; \/tmp\/event_handler.log # information on the event date and time<\/p>\n<p style=\"text-align: left\">\/usr\/bin\/id &gt;&gt; \/tmp\/event_handler.log # information on the user, on behalf of which the script was executed (to ensure control)<\/p>\n<p style=\"text-align: left\">#we need random string generators. One simple for logins, and the other is more complex for secure passwords.<\/p>\n<p style=\"text-align: left\">genpass_alphanum() {<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0local l=$1<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[ &#8220;$l&#8221; == &#8220;&#8221; ] &amp;&amp; l=16<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0tr -dc A-Za-z0-9_ &lt; \/dev\/urandom | head -c ${l} | xargs<\/p>\n<p style=\"text-align: left\">}<\/p>\n<p style=\"text-align: left\">genpass() {<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0local l=$1<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[ &#8220;$l&#8221; == &#8220;&#8221; ] &amp;&amp; l=16<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0tr -dc A-Za-z0-9\\_\\!\\@\\#\\$\\%\\^\\&amp;\\*\\?&lt; \/dev\/urandom | head -c ${l} | xargs<\/p>\n<p style=\"text-align: left\">}<\/p>\n<p style=\"text-align: left\">#We want to make we provide the latest WordPress version. See http:\/\/docs.plesk.com\/en-US\/12.5\/cli-linux\/using-command-line-utilities\/aps-application-catalog.63094\/ for more details on \u201cplesk bin aps\u201d functionality<\/p>\n<p style=\"text-align: left\">VER_RAW=(`plesk bin aps -gp|grep WordPress -A2 -B1|grep -v Vendor|awk &#8216;{print $2}&#8217;`)<\/p>\n<p style=\"text-align: left\">VER_LEN=${#VER_RAW[*]}<\/p>\n<p style=\"text-align: left\">VER=()<\/p>\n<p style=\"text-align: left\">for i in {0,$((VER_LEN\/3)),1}; do VER=(${VER[@]} ${VER_RAW[$((i*3-1))]}); done<\/p>\n<p style=\"text-align: left\">IFS=$&#8217;\\n&#8217; sorted=($(sort &lt;&lt;&lt;&#8220;${VER[*]}&#8221;))<\/p>\n<p style=\"text-align: left\">LVC=${#sorted[*]}<\/p>\n<p style=\"text-align: left\">LATEST_VER=${sorted[$((LVC-1))]}<\/p>\n<p style=\"text-align: left\">echo latest version is $LATEST_VER &gt;&gt;\/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">LATEST_PACKAGE_ID=`plesk bin aps -gp|grep $LATEST_VER -B3|head -1|awk &#8216;{print $2}&#8217;`<\/p>\n<p style=\"text-align: left\">echo latest package id is $LATEST_PACKAGE_ID &gt;&gt;\/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">echo &#8220;domain ${NEW_DOMAIN_NAME}&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\"># Find out plan name on which domain is created \u2013 see http:\/\/docs.plesk.com\/en-US\/12.5\/cli-linux\/using-command-line-utilities\/site-sites.67067\/ for reference<\/p>\n<p style=\"text-align: left\">PLAN=`plesk bin site -i &#8220;${NEW_DOMAIN_NAME}&#8221;|grep -i plan|awk -F\\&#8221; &#8216;{ print $2 }&#8217;`<\/p>\n<p style=\"text-align: left\">echo $PLAN &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">#if plan is right, we are installing WP, and for this we need to extract user name and email from domain owner, in order to provide WP with the same data, without having to make user correct it later<\/p>\n<p style=\"text-align: left\">if [ &#8220;$PLAN&#8221; == &#8220;$TARGET_PLAN&#8221; ]; then<\/p>\n<p style=\"text-align: left\">echo &#8220;${NEW_DOMAIN_NAME} is eligible for WP installation&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">USER=`plesk bin domain -i $NEW_DOMAIN_NAME|grep Owner|awk -F\\( &#8216;{print $2}&#8217;|awk -F\\) &#8216;{print $1}&#8217;`<\/p>\n<p style=\"text-align: left\">EMAIL=`plesk bin user -i $USER|grep mail|awk &#8216;{print $2}&#8217;`<\/p>\n<p style=\"text-align: left\">echo $USER $EMAIL &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">#Generating password, login, database name and database user name<\/p>\n<p style=\"text-align: left\">echo &#8220;installing WordPress version $LATEST_VER package ID $LATEST_PACKAGE_ID for domain ${NEW_DOMAIN_NAME}&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">echo &#8220;generating secure password&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">PASSWD=`genpass 8`_<\/p>\n<p style=\"text-align: left\">#echo &#8220;Password $PASSWD&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">echo &#8220;generating db name and db user name&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">DBUSER=admin_`genpass_alphanum 6`<\/p>\n<p style=\"text-align: left\">echo &#8220;DB User $DBUSER&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">DBNAME=wp_`genpass_alphanum 6`<\/p>\n<p style=\"text-align: left\">echo &#8220;DB Name $DBNAME&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\"># We need to generate an XML template for Plesk to provide an APS package. Each APS package has its own requirements to the template. In WP template we need to put user name, email address, password and locale \u2013 all this information will be used in WordPress instance. User can edit it later.<\/p>\n<p style=\"text-align: left\">echo &#8220;Generating template for WP&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">echo &#8220;&lt;?xml version=\\&#8221;1.0\\&#8221;?&gt;<\/p>\n<p style=\"text-align: left\">&lt;settings&gt;<\/p>\n<p style=\"text-align: left\">\u00a0&lt;setting&gt;<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0&lt;name&gt;admin_email&lt;\/name&gt;<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0&lt;value&gt;$EMAIL&lt;\/value&gt;<\/p>\n<p style=\"text-align: left\">\u00a0&lt;\/setting&gt;<\/p>\n<p style=\"text-align: left\">\u00a0&lt;setting&gt;<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0&lt;name&gt;admin_name&lt;\/name&gt;<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0&lt;value&gt;$NEW_SYSTEM_USER&lt;\/value&gt;<\/p>\n<p style=\"text-align: left\">\u00a0&lt;\/setting&gt;<\/p>\n<p style=\"text-align: left\">\u00a0&lt;setting&gt;<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0&lt;name&gt;admin_password&lt;\/name&gt;<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0&lt;value&gt;$PASSWD&lt;\/value&gt;<\/p>\n<p style=\"text-align: left\">\u00a0&lt;\/setting&gt;<\/p>\n<p style=\"text-align: left\">\u00a0&lt;setting&gt;<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0&lt;name&gt;locale&lt;\/name&gt;<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0&lt;value&gt;en-US&lt;\/value&gt;<\/p>\n<p style=\"text-align: left\">\u00a0&lt;\/setting&gt;<\/p>\n<p style=\"text-align: left\">\u00a0&lt;setting&gt;<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0&lt;name&gt;title&lt;\/name&gt;<\/p>\n<p style=\"text-align: left\">\u00a0\u00a0&lt;value&gt;WordPress&lt;\/value&gt;<\/p>\n<p style=\"text-align: left\">\u00a0&lt;\/setting&gt;<\/p>\n<p style=\"text-align: left\">&lt;\/settings&gt;&#8221; &gt; \/tmp\/template1.xml<\/p>\n<p style=\"text-align: left\">#now ready to install WordPress instance. First let\u2019s log command to execute<\/p>\n<p style=\"text-align: left\">echo &#8220;plesk bin aps &#8211;install &#8220;\/tmp\/template1.xml&#8221; -package-id $LATEST_PACKAGE_ID -domain ${NEW_DOMAIN_NAME} -ssl false -url-prefix wordpress -db-name $DBNAME -db-user $DBUSER -passwd \\&#8221;$PASSWD\\&#8221; &#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">#and fire it for real<\/p>\n<p style=\"text-align: left\">plesk bin aps &#8211;install &#8220;\/tmp\/template1.xml&#8221; -package-id $LATEST_PACKAGE_ID -domain ${NEW_DOMAIN_NAME} -ssl false -url-prefix wordpress -db-name $DBNAME -db-user $DBUSER -passwd &#8220;$PASSWD&#8221; &gt;&gt; \/tmp\/event_handler.log 2&gt;&amp;1<\/p>\n<p style=\"text-align: left\">#you might want to remove logging in the above line, as APS package installation produces a lot of output.<\/p>\n<p style=\"text-align: left\">echo &#8220;Finished installing WordPress for domain ${NEW_DOMAIN_NAME}&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">echo &#8220;Notifying user of successful installation&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">#Optional email notification sent out to the domain owner. Make sure your Plesk has correct FQDN and DNS is setup properly.<\/p>\n<p style=\"text-align: left\">mail -s &#8220;Your WordPress is ready&#8221; &#8220;$EMAIL&#8221; &lt;&lt;EOF<\/p>\n<p style=\"text-align: left\">Hello, $USER.<\/p>\n<p style=\"text-align: left\">Your WordPress installation is ready.<\/p>\n<p style=\"text-align: left\">To access it, open ${NEW_DOMAIN_NAME}\/wordpress<\/p>\n<p style=\"text-align: left\">Login: $NEW_SYSTEM_USER<\/p>\n<p style=\"text-align: left\">Password: $PASSWD<\/p>\n<p style=\"text-align: left\">EOF<\/p>\n<p style=\"text-align: left\">rm \/tmp\/template1.xml \u2013f<\/p>\n<p style=\"text-align: left\">#If plan name is not our target plan, skipping the installation<\/p>\n<p style=\"text-align: left\">else echo\u00a0\u00a0&#8220;${NEW_DOMAIN_NAME} does not need WP installation&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<p style=\"text-align: left\">fi<\/p>\n<p style=\"text-align: left\">echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221; &gt;&gt; \/tmp\/event_handler.log<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: justify\"><strong>\u0627\u06cc\u0646 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0686\u06af\u0648\u0646\u0647 \u06a9\u0627\u0631 \u0645\u06cc \u06a9\u0646\u062f\u061f<\/strong><\/p>\n<p style=\"text-align: justify\">\u062f\u0631 \u067e\u0644\u0646 \u0648\u0631\u062f\u067e\u0631\u0633\u060c \u06cc\u06a9 \u0627\u0634\u062a\u0631\u0627\u06a9 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-931\" src=\"http:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/5.png\" alt=\"5\" width=\"636\" height=\"391\" srcset=\"https:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/5.png 677w, https:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/5-300x185.png 300w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/p>\n<p style=\"text-align: justify\">\u0628\u0627\u06cc\u062f \u0628\u0628\u06cc\u0646\u06cc\u062f\u060c Instance \u0648\u0631\u062f\u067e\u0631\u0633 \u0641\u0631\u0627\u0647\u0645 \u0634\u062f\u0647 \u0627\u0633\u062a \u06cc\u0627 \u062e\u06cc\u0631. \u0647\u0645\u0627\u0646\u0637\u0648\u0631 \u06a9\u0647 \u0645\u0634\u0627\u0647\u062f\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u062f \u0646\u0635\u0628 \u0646\u0633\u062e\u0647 \u062c\u062f\u06cc\u062f \u0648\u0631\u062f\u067e\u0631\u0633 \u0628\u062f\u0648\u0646 \u0647\u06cc\u0686 \u062e\u0637\u0627\u06cc\u06cc \u0627\u0646\u062c\u0627\u0645 \u0634\u062f\u0647 \u0627\u0633\u062a. \u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u0646\u0634\u0627\u0646 \u0645\u06cc \u062f\u0647\u062f \u06a9\u0647 \u0622\u062e\u0631\u06cc\u0646 \u0646\u0633\u062e\u0647 \u0627\u0632 \u0622\u0646 \u0628\u0647 \u062e\u0648\u0628\u06cc\u00a0 \u0646\u0635\u0628 \u0648 \u0641\u0639\u0627\u0644 \u0627\u0633\u062a.<\/p>\n<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-932\" src=\"http:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/6.png\" alt=\"6\" width=\"583\" height=\"487\" srcset=\"https:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/6.png 583w, https:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/6-300x251.png 300w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/p>\n<p style=\"text-align: justify\"><a href=\"https:\/\/devblog.plesk.com\/2016\/11\/autowordpress-plesk\/\">\u0645\u0646\u0628\u0639<\/a><\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;926&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 \u0627\u0645\u062a\u06cc\u0627\u0632)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;\u062e\u0648\u062f\u06a9\u0627\u0631\u0633\u0627\u0632\u06cc \u0646\u0635\u0628 \u0648\u0631\u062f\u067e\u0631\u0633 \u0628\u0627 \u067e\u0644\u0633\u06a9&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-left: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u0628\u06cc \u0634\u06a9 \u0634\u0645\u0627 \u0646\u06cc\u0632 \u062f\u0631 \u0645\u0648\u0631\u062f \u0646\u062d\u0648\u0647 \u0646\u0635\u0628 \u0633\u0631\u06cc\u0639 \u0648\u0631\u062f\u067e\u0631\u0633 \u0628\u0627 \u067e\u0644\u0633\u06a9 \u0627\u0637\u0644\u0627\u0639\u0627\u062a\u06cc \u062f\u0627\u0631\u06cc\u062f.\u00a0 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0645\u062a\u062e\u0635\u0635 \u0647\u0627\u0633\u062a\u06cc\u0646\u06af\u060c \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u06cc\u0646 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0631\u0627 \u062f\u0631 \u0627\u062e\u062a\u06cc\u0627\u0631 \u0645\u0634\u062a\u0631\u06cc\u0627\u0646 \u062e\u0648\u062f \u0646\u06cc\u0632 \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f.\u062f\u0631 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0642\u0635\u062f \u062f\u0627\u0631\u06cc\u0645 \u062e\u0648\u062f\u06a9\u0627\u0631\u0633\u0627\u0632\u06cc \u0646\u0635\u0628 \u0648\u0631\u062f\u067e\u0631\u0633 \u062f\u0631 \u067e\u0644\u0633\u06a9 \u0631\u0627 \u0628\u0627 \u0647\u0645 \u0645\u0631\u0648\u0631 \u06a9\u0646\u06cc\u0645. \u067e\u0633 \u0647\u0645\u0631\u0627\u0647 \u0648\u0628 \u0627\u06cc\u062f\u0647 \u0628\u0627\u0634\u06cc\u062f.<\/p>\n","protected":false},"author":8,"featured_media":933,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10,4],"tags":[20,533,7],"class_list":["post-926","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","category-server-manage","tag-20","tag-533","tag-7"],"views":"1045","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/parry3-eW","jetpack_featured_media_url":"https:\/\/webide.ir\/blog\/wp-content\/uploads\/2016\/11\/Fotolia_105477591_Subscription_Monthly_M-730x300.jpg","_links":{"self":[{"href":"https:\/\/webide.ir\/blog\/wp-json\/wp\/v2\/posts\/926","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webide.ir\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webide.ir\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webide.ir\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/webide.ir\/blog\/wp-json\/wp\/v2\/comments?post=926"}],"version-history":[{"count":0,"href":"https:\/\/webide.ir\/blog\/wp-json\/wp\/v2\/posts\/926\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webide.ir\/blog\/wp-json\/wp\/v2\/media\/933"}],"wp:attachment":[{"href":"https:\/\/webide.ir\/blog\/wp-json\/wp\/v2\/media?parent=926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webide.ir\/blog\/wp-json\/wp\/v2\/categories?post=926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webide.ir\/blog\/wp-json\/wp\/v2\/tags?post=926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}