{"id":311915,"date":"2020-10-23T09:00:41","date_gmt":"2020-10-23T09:00:41","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=311915"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=311915","title":{"rendered":"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 WordPress \u0441 NGINX Unit \u0438 Ubuntu"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dd\/uo\/ka\/dduokadhwhdzg4drs-0vs2lt4vg.png\"><\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 WordPress, \u043f\u043e\u0438\u0441\u043a \u0432 Google \u043f\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u0430\u043c &quot;WordPress install&quot; \u0432\u044b\u0434\u0430\u0441\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u043f\u043e\u043b\u0443\u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. \u041d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0432\u0435\u0441\u044c\u043c\u0430 \u043c\u0430\u043b\u043e \u0433\u043e\u0434\u043d\u044b\u0445 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c WordPress \u0438 \u043d\u0438\u0436\u0435\u043b\u0435\u0436\u0430\u0449\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439, \u0438\u043b\u0438 \u0436\u0435 \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u044c\u044e \u0442\u044f\u0436\u0435\u043b\u043e\u0439 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435\u0435 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 bash \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 WordPress \u043d\u0430 Ubuntu, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u043d\u0435\u043c\u0443, \u043f\u043e\u044f\u0441\u043d\u044f\u044f, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0435\u0433\u043e \u043a\u0443\u0441\u043e\u0447\u0435\u043a, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430 \u043a\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u044b \u043c\u044b \u043f\u043e\u0448\u043b\u0438 \u043f\u0440\u0438 \u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u2014 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e <a href=\"https:\/\/gist.github.com\/nginx-gists\/bdc7da70b124c4f3e472970c7826cccc\">\u0432\u0437\u044f\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442<\/a> \u0434\u043b\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0432\u0430\u0448\u0438\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 WordPress \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 Lets Encrypt, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0430\u044f \u043d\u0430 NGINX Unit \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u0430\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f WordPress \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c NGINX Unit \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0432 <a href=\"https:\/\/www.nginx.com\/blog\/installing-wordpress-with-nginx-unit\/\">\u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0432\u0435\u0449\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043c \u043d\u0435 \u0431\u044b\u043b\u0438 \u043e\u0445\u0432\u0430\u0447\u0435\u043d\u044b (\u043a\u0430\u043a \u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430\u0445):<\/p>\n<p>  <\/p>\n<ul>\n<li>WordPress CLI<\/li>\n<li>Let&#8217;s Encrypt \u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b TLS\\SSL<\/li>\n<li>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432<\/li>\n<li>\u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 NGINX<\/li>\n<li>\u0421\u0436\u0430\u0442\u0438\u0435 NGINX<\/li>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 HTTPS \u0438 HTTP\/2<\/li>\n<li>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0442\u0430\u0442\u0438\u043a\u0438, \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 PHP, \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0445\u043e\u0441\u0442\u043e\u0432 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u2014 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435. \u0425\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043e \u0447\u0435\u043c-\u0442\u043e, \u0447\u0435\u0433\u043e \u043d\u0435\u0442 \u0432 \u044d\u0442\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u2014 \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>  <\/p>\n<h2 id=\"trebovaniya\">\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<ul>\n<li>\u0421\u0435\u0440\u0432\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 (<a href=\"https:\/\/linuxcontainers.org\/lxc\/getting-started\/\">LXC<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/linuxcontainers.org\/lxd\/getting-started-cli\/\">LXD<\/a>), \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430, \u0438\u043b\u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0436\u0435\u043b\u0435\u0437\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u0441 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c 512\u041c\u0431 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 Ubuntu 18.04 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0432\u0435\u0436\u0435\u0439.<\/li>\n<li>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043f\u043e\u0440\u0442\u044b 80 \u0438 443<\/li>\n<li>\u0414\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u0441 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c ip-\u0430\u0434\u0440\u0435\u0441\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/li>\n<li>\u0414\u043e\u0441\u0442\u0443\u043f \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 root (sudo).<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"obzor-arhitektury\">\u041e\u0431\u0437\u043e\u0440 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b<\/h2>\n<p>  <\/p>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0442\u0430\u043a\u0430\u044f \u0436\u0435, \u043a\u0430\u043a \u0431\u044b\u043b\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e <a href=\"https:\/\/www.nginx.com\/blog\/installing-wordpress-with-nginx-unit\/#Architecture-Overview\">\u0440\u0430\u043d\u0435\u0435<\/a>, \u0442\u0440\u0435\u0445\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0435 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041e\u043d\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 PHP, \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 PHP, \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3b\/ht\/eb\/3bhtebudb6ri9foqx4plc4_tpzk.png\"><\/p>\n<p>  <\/p>\n<h2 id=\"obschie-principy\">\u041e\u0431\u0449\u0438\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b<\/h2>\n<p>  <\/p>\n<ul>\n<li>\u041c\u043d\u043e\u0433\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044b \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f (if) \u0434\u043b\u044f \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438: \u0441\u043a\u0440\u0438\u043f\u0442 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0431\u0435\u0437 \u0440\u0438\u0441\u043a\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b.<\/li>\n<li>\u0421\u043a\u0440\u0438\u043f\u0442 \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u041f\u041e \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u043e\u0434\u043d\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 (<code>apt upgrade<\/code> \u0434\u043b\u044f Ubuntu).<\/li>\n<li>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0441\u0442\u0430\u0440\u0430\u044e\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0432\u043e\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/li>\n<li>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432\\\u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445, \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0431\u0443\u0435\u0442 \u0443\u0433\u0430\u0434\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445, \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445, \u00ab\u0436\u0435\u043b\u0435\u0437\u043d\u044b\u0445\u00bb \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445.<\/li>\n<li>\u041f\u0440\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u0443\u043c\u0430\u0435\u043c \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043e\u0431 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u043a\u0430\u043a \u043c\u044b \u043d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u0430\u043a \u043a\u043e\u0434\u0430.<\/li>\n<li>\u0412\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <strong>root<\/strong>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043d\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e WordPress \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"ustanovka-peremennyh-okruzheniya\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>WORDPRESS_DB_PASSWORD<\/code> \u2014 \u043f\u0430\u0440\u043e\u043b\u044c \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 WordPress<\/li>\n<li><code>WORDPRESS_ADMIN_USER<\/code> \u2014 \u0438\u043c\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 WordPress<\/li>\n<li><code>WORDPRESS_ADMIN_PASSWORD<\/code> \u2014 \u043f\u0430\u0440\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 WordPress<\/li>\n<li><code>WORDPRESS_ADMIN_EMAIL<\/code> \u2014 email \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 WordPress<\/li>\n<li><code>WORDPRESS_URL<\/code> \u2014 \u043f\u043e\u043b\u043d\u044b\u0439 URL \u0441\u0430\u0439\u0442\u0430 WordPress, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 <code>https:\/\/<\/code>.<\/li>\n<li><code>LETS_ENCRYPT_STAGING<\/code> \u2014 \u043f\u0443\u0441\u0442\u0430\u044f \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043d\u043e, \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 1, \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c staging \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Let\u2019s Encrypt, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0447\u0430\u0441\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0430\u0448\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u0438\u043d\u0430\u0447\u0435 Let\u2019s Encrypt \u043c\u043e\u0436\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448 ip-\u0430\u0434\u0440\u0435\u0441 \u0438\u0437-\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 WordPress \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b, \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442.<br \/>  \u0421\u0442\u0440\u043e\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 572-576 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>LETS_ENCRYPT_STAGING<\/code>.<\/p>\n<p>  <\/p>\n<h2 id=\"ustanovka-proizvodnyh-peremennyh-okruzheniya\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 55-61 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043b\u0438\u0431\u043e \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0436\u0435\u0441\u0442\u043a\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043b\u0438\u0431\u043e \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>DEBIAN_FRONTEND=&quot;noninteractive&quot;<\/code> \u2014 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0438 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c.<\/li>\n<li><code>WORDPRESS_CLI_VERSION=&quot;2.4.0&quot;<\/code> \u2014 \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f WordPress CLI.<\/li>\n<li><code>WORDPRESS_CLI_MD5= &quot;dedd5a662b80cda66e9e25d44c23b25c&quot;<\/code> \u2014 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0430\u044f \u0441\u0443\u043c\u043c\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 WordPress CLI 2.4.0 (\u0432\u0435\u0440\u0441\u0438\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>WORDPRESS_CLI_VERSION<\/code>). \u0421\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 162 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0447\u0442\u043e \u0431\u044b\u043b \u0441\u043a\u0430\u0447\u0430\u043d \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0444\u0430\u0439\u043b WordPress CLI.<\/li>\n<li><code>UPLOAD_MAX_FILESIZE=&quot;16M&quot;<\/code> \u2014 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043a\u0430\u0447\u0430\u043d \u0432 WordPress. \u042d\u0442\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u043e\u0449\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435.<\/li>\n<li><code>TLS_HOSTNAME= &quot;$(echo ${WORDPRESS_URL} | cut -d'\/' -f3)&quot;<\/code> \u2014 hostname \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c\u044b\u0439 \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 WORDPRESS_URL. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 TLS\/SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u043e\u0442 Let\u2019s Encrypt, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 WordPress.<\/li>\n<li><code>NGINX_CONF_DIR=&quot;\/etc\/nginx&quot;<\/code> \u2014 \u043f\u0443\u0442\u044c \u043a \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0443 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 NGINX, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0430\u0439\u043b <code>nginx.conf<\/code>.<\/li>\n<li><code>CERT_DIR=&quot;\/etc\/letsencrypt\/live\/${TLS_HOSTNAME}&quot;<\/code> \u2014 \u043f\u0443\u0442\u044c \u043a \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430\u043c Let\u2019s Encrypt \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430 WordPress, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>TLS_HOSTNAME<\/code>.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"naznachenie-hostname-wordpress-serveru\">\u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 hostname WordPress \u0441\u0435\u0440\u0432\u0435\u0440\u0443<\/h2>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 hostname \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0447\u0442\u043e\u0431\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u0438 \u0441\u0430\u0439\u0442\u0430. \u042d\u0442\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0442\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u043f\u043e\u0447\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 SMTP \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043a\u0430\u043a \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># Change the hostname to be the same as the WordPress hostname if [ ! &quot;$(hostname)&quot; == &quot;${TLS_HOSTNAME}&quot; ]; then   echo &quot; Changing hostname to ${TLS_HOSTNAME}&quot;   hostnamectl set-hostname &quot;${TLS_HOSTNAME}&quot; fi<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"dobavlenie-hostname-v-etchosts\">\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 hostname \u0432 \/etc\/hosts<\/h2>\n<p>  <\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 <a href=\"https:\/\/developer.wordpress.org\/plugins\/cron\/\">WP\u2011Cron<\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447, \u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043e\u0431\u044b WordPress \u043c\u043e\u0433 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0441\u0435\u0431\u0435 \u0447\u0435\u0440\u0435\u0437 HTTP. \u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e WP-Cron \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043d\u0430 \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445, \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432 \u0444\u0430\u0439\u043b <strong>\/etc\/hosts<\/strong>, \u0442\u0430\u043a \u0447\u0442\u043e WordPress \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0441\u0435\u0431\u0435 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 loopback:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># Add the hostname to \/etc\/hosts if [ &quot;$(grep -m1 &quot;${TLS_HOSTNAME}&quot; \/etc\/hosts)&quot; = &quot;&quot; ]; then   echo &quot; Adding hostname ${TLS_HOSTNAME} to \/etc\/hosts so that WordPress can ping itself&quot;   printf &quot;::1 %s\\n127.0.0.1 %s\\n&quot; &quot;${TLS_HOSTNAME}&quot; &quot;${TLS_HOSTNAME}&quot; &gt;&gt; \/etc\/hosts fi<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"ustanovka-instrumentov-trebuemyh-dlya-posleduyuschih-shagov\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0433\u043e\u0432<\/h2>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u0432\u0448\u0430\u044f\u0441\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445 \u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b. \u041c\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># Make sure tools needed for install are present echo &quot; Installing prerequisite tools&quot; apt-get -qq update apt-get -qq install -y \\   bc \\   ca-certificates \\   coreutils \\   curl \\   gnupg2 \\   lsb-release<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"dobavlenie-repozitoriev-nginx-unit-i-nginx\">\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 NGINX Unit \u0438 NGINX<\/h2>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 NGINX Unit \u0438 NGINX \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 NGINX, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u0438 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 NGINX Unit, \u0430 \u0437\u0430\u0442\u0435\u043c \u2014 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 NGINX, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043a\u043b\u044e\u0447 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 \u0438 \u0444\u0430\u0439\u043b\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a <code>apt<\/code>, \u0437\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u043c \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 NGINX Unit \u0438 NGINX \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435. \u041c\u044b \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># Install the NGINX Unit repository if [ ! -f \/etc\/apt\/sources.list.d\/unit.list ]; then   echo &quot; Installing NGINX Unit repository&quot;   curl -fsSL https:\/\/nginx.org\/keys\/nginx_signing.key | apt-key add -   echo &quot;deb https:\/\/packages.nginx.org\/unit\/ubuntu\/ $(lsb_release -cs) unit&quot; &gt; \/etc\/apt\/sources.list.d\/unit.list fi  # Install the NGINX repository if [ ! -f \/etc\/apt\/sources.list.d\/nginx.list ]; then   echo &quot; Installing NGINX repository&quot;   curl -fsSL https:\/\/nginx.org\/keys\/nginx_signing.key | apt-key add -   echo &quot;deb https:\/\/nginx.org\/packages\/mainline\/ubuntu $(lsb_release -cs) nginx&quot; &gt; \/etc\/apt\/sources.list.d\/nginx.list fi<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"ustanovka-nginx-nginx-unit-php-mariadb-certbot-lets-encrypt-i-ih-zavisimostey\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 NGINX, NGINX Unit, PHP MariaDB, Certbot (Let\u2019s Encrypt) \u0438 \u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/h2>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b, \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u0430\u043a\u0435\u0442\u044b, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c, \u0442\u0430\u043a\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f PHP, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 WordPress.org<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">echo &quot; Updating repository metadata&quot; apt-get -qq update  # Install PHP with dependencies and NGINX Unit echo &quot; Installing PHP, NGINX Unit, NGINX, Certbot, and MariaDB&quot; apt-get -qq install -y --no-install-recommends \\   certbot \\   python3-certbot-nginx \\   php-cli \\   php-common \\   php-bcmath \\   php-curl \\   php-gd \\   php-imagick \\   php-mbstring \\   php-mysql \\   php-opcache \\   php-xml \\   php-zip \\   ghostscript \\   nginx \\   unit \\   unit-php \\   mariadb-server<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"nastroyka-php-dlya-ispolzovaniya-s-nginx-unit-i-wordpress\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 PHP \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441 NGINX Unit \u0438 WordPress<\/h2>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <strong>conf.d<\/strong>. \u0422\u0443\u0442 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f PHP, \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434 \u043e\u0448\u0438\u0431\u043e\u043a PHP \u0432 STDERR, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0436\u0443\u0440\u043d\u0430\u043b NGINX Unit, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f NGINX Unit.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># Find the major and minor PHP version so that we can write to its conf.d directory PHP_MAJOR_MINOR_VERSION=&quot;$(php -v | head -n1 | cut -d' ' -f2 | cut -d'.' -f1,2)&quot;  if [ ! -f &quot;\/etc\/php\/${PHP_MAJOR_MINOR_VERSION}\/embed\/conf.d\/30-wordpress-overrides.ini&quot; ]; then   echo &quot; Configuring PHP for use with NGINX Unit and WordPress&quot;   # Add PHP configuration overrides   cat &gt; &quot;\/etc\/php\/${PHP_MAJOR_MINOR_VERSION}\/embed\/conf.d\/30-wordpress-overrides.ini&quot; &lt;&lt; EOM ; Set a larger maximum upload size so that WordPress can handle ; bigger media files. upload_max_filesize=${UPLOAD_MAX_FILESIZE} post_max_size=${UPLOAD_MAX_FILESIZE} ; Write error log to STDERR so that error messages show up in the NGINX Unit log error_log=\/dev\/stderr EOM fi  # Restart NGINX Unit because we have reconfigured PHP echo &quot; Restarting NGINX Unit&quot; service unit restart<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"zadanie-nastroek-bazy-dannyh-mariadb-dlya-wordpress\">\u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 MariaDB \u0434\u043b\u044f WordPress<\/h2>\n<p>  <\/p>\n<p>\u041c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 MariaDB \u0432\u043c\u0435\u0441\u0442\u043e MySQL, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043d\u0435\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043e\u043d\u0430, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, <a href=\"https:\/\/blog.kernl.us\/2019\/10\/wordpress-database-performance-showdown-mysql-vs-mariadb-vs-percona\/\">\u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/a> (<em>\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0442\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0449\u0435: \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c MySQL, \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/em>, \u043f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430).<\/p>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 WordPress \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 loopback:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># Set up the WordPress database echo &quot; Configuring MariaDB for WordPress&quot; mysqladmin create wordpress || echo &quot;Ignoring above error because database may already exist&quot; mysql -e &quot;GRANT ALL PRIVILEGES ON wordpress.* TO \\&quot;wordpress\\&quot;@\\&quot;localhost\\&quot; IDENTIFIED BY \\&quot;$WORDPRESS_DB_PASSWORD\\&quot;; FLUSH PRIVILEGES;&quot;<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"ustanovka-programmy-wordpress-cli\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b WordPress CLI<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 <a href=\"https:\/\/wp-cli.org\/\">WP-CLI<\/a>. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 WordPress \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0443\u0447\u043d\u043e\u0439 \u043f\u0440\u0430\u0432\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0438\u043b\u0438 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043f\u0430\u043d\u0435\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0435\u043c\u044b \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 WordPress.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">if [ ! -f \/usr\/local\/bin\/wp ]; then   # Install the WordPress CLI   echo &quot; Installing the WordPress CLI tool&quot;   curl --retry 6 -Ls &quot;https:\/\/github.com\/wp-cli\/wp-cli\/releases\/download\/v${WORDPRESS_CLI_VERSION}\/wp-cli-${WORDPRESS_CLI_VERSION}.phar&quot; &gt; \/usr\/local\/bin\/wp   echo &quot;$WORDPRESS_CLI_MD5 \/usr\/local\/bin\/wp&quot; | md5sum -c -   chmod +x \/usr\/local\/bin\/wp fi<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"ustanovka-i-nastroyka-wordpress\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 WordPress<\/h2>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e WordPress \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 <code>\/var\/www\/wordpress<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 unix domain socket \u0432\u043c\u0435\u0441\u0442\u043e TCP \u043d\u0430 loopback, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a TCP.<\/li>\n<li>WordPress \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 <strong>https:\/\/<\/strong> \u043a URL, \u0435\u0441\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0441 NGINX \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 HTTPS, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 hostname (\u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 NGINX) \u0432 PHP. \u041c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u043a\u043e\u0434\u0430, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c.<\/li>\n<li>WordPress \u043d\u0443\u0436\u043d\u043e HTTPS \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u0430<\/li>\n<li>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 URL \u043f\u043e \u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445<\/li>\n<li>\u0412\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0434\u043b\u044f \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 WordPress.<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">if [ ! -d \/var\/www\/wordpress ]; then   # Create WordPress directories   mkdir -p \/var\/www\/wordpress   chown -R www-data:www-data \/var\/www    # Download WordPress using the WordPress CLI   echo &quot; Installing WordPress&quot;   su -s \/bin\/sh -c 'wp --path=\/var\/www\/wordpress core download' www-data    WP_CONFIG_CREATE_CMD=&quot;wp --path=\/var\/www\/wordpress config create --extra-php --dbname=wordpress --dbuser=wordpress --dbhost=\\&quot;localhost:\/var\/run\/mysqld\/mysqld.sock\\&quot; --dbpass=\\&quot;${WORDPRESS_DB_PASSWORD}\\&quot;&quot;    # This snippet is injected into the wp-config.php file when it is created;   # it informs WordPress that we are behind a reverse proxy and as such   # allows it to generate links using HTTPS   cat &gt; \/tmp\/wp_forwarded_for.php &lt;&lt; 'EOM' \/* Turn HTTPS 'on' if HTTP_X_FORWARDED_PROTO matches 'https' *\/ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &amp;&amp; strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) {     $_SERVER['HTTPS'] = 'on'; } if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {     $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST']; } EOM    # Create WordPress configuration   su -s \/bin\/sh -p -c &quot;cat \/tmp\/wp_forwarded_for.php | ${WP_CONFIG_CREATE_CMD}&quot; www-data   rm \/tmp\/wp_forwarded_for.php   su -s \/bin\/sh -p -c &quot;wp --path=\/var\/www\/wordpress config set 'FORCE_SSL_ADMIN' 'true'&quot; www-data    # Install WordPress   WP_SITE_INSTALL_CMD=&quot;wp --path=\/var\/www\/wordpress core install --url=\\&quot;${WORDPRESS_URL}\\&quot; --title=\\&quot;${WORDPRESS_SITE_TITLE}\\&quot; --admin_user=\\&quot;${WORDPRESS_ADMIN_USER}\\&quot; --admin_password=\\&quot;${WORDPRESS_ADMIN_PASSWORD}\\&quot; --admin_email=\\&quot;${WORDPRESS_ADMIN_EMAIL}\\&quot; --skip-email&quot;   su -s \/bin\/sh -p -c &quot;${WP_SITE_INSTALL_CMD}&quot; www-data    # Set permalink structure to a sensible default that isn't in the UI   su -s \/bin\/sh -p -c &quot;wp --path=\/var\/www\/wordpress option update permalink_structure '\/%year%\/%monthnum%\/%postname%\/'&quot; www-data    # Remove sample file because it is cruft and could be a security problem   rm \/var\/www\/wordpress\/wp-config-sample.php    # Ensure that WordPress permissions are correct   find \/var\/www\/wordpress -type d -exec chmod g+s {} \\;   chmod g+w \/var\/www\/wordpress\/wp-content   chmod -R g+w \/var\/www\/wordpress\/wp-content\/themes   chmod -R g+w \/var\/www\/wordpress\/wp-content\/plugins fi<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"nastroyka-nginx-unit\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 NGINX Unit<\/h2>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 NGINX Unit \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 PHP \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0443\u0442\u0435\u0439 WordPress, \u0438\u0437\u043e\u043b\u0438\u0440\u0443\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 PHP \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0422\u0443\u0442 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d, \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d <strong>network<\/strong>. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c WordPress \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0438 \u043a endpoints \u0438 \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435.<\/li>\n<li>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: <strong>(\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 MariaDB \u0438 NGINX Uniy)\/(\u043f\u0440\u0435\u0434\u0435\u043b \u043f\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 PHP + 5)<\/strong><br \/>  \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 NGINX Unit.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0432\u0430 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 PHP, \u0447\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 WordPress \u0434\u0435\u043b\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0441\u0435\u0431\u0435, \u0430 \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, WP-Cron, \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f. \u0412\u044b, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0438\u043b\u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u044d\u0442\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u0432\u0430\u0448\u0438\u0445 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u0434\u0435\u0441\u044c \u2014 \u043a\u043e\u043d\u0441\u0435\u0440\u0432\u0430\u0442\u0438\u0432\u043d\u044b\u0435. \u041d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 10 \u0438 100.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">if [ &quot;${container:-unknown}&quot; != &quot;lxc&quot; ] &amp;&amp; [ &quot;$(grep -m1 -a container=lxc \/proc\/1\/environ | tr -d '\\0')&quot; == &quot;&quot; ]; then   NAMESPACES='&quot;namespaces&quot;: {         &quot;cgroup&quot;: true,         &quot;credential&quot;: true,         &quot;mount&quot;: true,         &quot;network&quot;: false,         &quot;pid&quot;: true,         &quot;uname&quot;: true     }' else   NAMESPACES='&quot;namespaces&quot;: {}' fi  PHP_MEM_LIMIT=&quot;$(grep 'memory_limit' \/etc\/php\/7.4\/embed\/php.ini | tr -d ' ' | cut -f2 -d= | numfmt --from=iec)&quot; AVAIL_MEM=&quot;$(grep MemAvailable \/proc\/meminfo | tr -d ' kB' | cut -f2 -d: | numfmt --from-unit=K)&quot; MAX_PHP_PROCESSES=&quot;$(echo &quot;${AVAIL_MEM}\/${PHP_MEM_LIMIT}+5&quot; | bc)&quot; echo &quot; Calculated the maximum number of PHP processes as ${MAX_PHP_PROCESSES}. You may want to tune this value due to variations in your configuration. It is not unusual to see values between 10-100 in production configurations.&quot;  echo &quot; Configuring NGINX Unit to use PHP and WordPress&quot; cat &gt; \/tmp\/wordpress.json &lt;&lt; EOM {   &quot;settings&quot;: {     &quot;http&quot;: {       &quot;header_read_timeout&quot;: 30,       &quot;body_read_timeout&quot;: 30,       &quot;send_timeout&quot;: 30,       &quot;idle_timeout&quot;: 180,       &quot;max_body_size&quot;: $(numfmt --from=iec ${UPLOAD_MAX_FILESIZE})     }   },   &quot;listeners&quot;: {     &quot;127.0.0.1:8080&quot;: {       &quot;pass&quot;: &quot;routes\/wordpress&quot;     }   },   &quot;routes&quot;: {     &quot;wordpress&quot;: [       {         &quot;match&quot;: {           &quot;uri&quot;: [             &quot;*.php&quot;,             &quot;*.php\/*&quot;,             &quot;\/wp-admin\/&quot;           ]         },         &quot;action&quot;: {           &quot;pass&quot;: &quot;applications\/wordpress\/direct&quot;         }       },       {         &quot;action&quot;: {           &quot;share&quot;: &quot;\/var\/www\/wordpress&quot;,           &quot;fallback&quot;: {             &quot;pass&quot;: &quot;applications\/wordpress\/index&quot;           }         }       }     ]   },   &quot;applications&quot;: {     &quot;wordpress&quot;: {       &quot;type&quot;: &quot;php&quot;,       &quot;user&quot;: &quot;www-data&quot;,       &quot;group&quot;: &quot;www-data&quot;,       &quot;processes&quot;: {         &quot;max&quot;: ${MAX_PHP_PROCESSES},         &quot;spare&quot;: 1       },       &quot;isolation&quot;: {         ${NAMESPACES}       },       &quot;targets&quot;: {         &quot;direct&quot;: {           &quot;root&quot;: &quot;\/var\/www\/wordpress\/&quot;         },         &quot;index&quot;: {           &quot;root&quot;: &quot;\/var\/www\/wordpress\/&quot;,           &quot;script&quot;: &quot;index.php&quot;         }       }     }   } } EOM  curl -X PUT --data-binary @\/tmp\/wordpress.json --unix-socket \/run\/control.unit.sock http:\/\/localhost\/config<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"nastroyka-nginx\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 NGINX<\/h2>\n<p>  <\/p>\n<h3 id=\"nastroyka-osnovnyh-parametrov-nginx\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 NGINX<\/h3>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0434\u043b\u044f \u043a\u044d\u0448\u0430 NGINX, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 <code>nginx.conf<\/code>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0422\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0436\u0430\u0442\u0438\u044f, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435, \u0434\u0430\u043b\u0435\u0435 \u0438\u0434\u0443\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\"># Make directory for NGINX cache mkdir -p \/var\/cache\/nginx\/proxy  echo &quot; Configuring NGINX&quot; cat &gt; ${NGINX_CONF_DIR}\/nginx.conf &lt;&lt; EOM user nginx; worker_processes auto; error_log  \/var\/log\/nginx\/error.log warn; pid        \/var\/run\/nginx.pid; events {     worker_connections  1024; } http {     include       ${NGINX_CONF_DIR}\/mime.types;     default_type  application\/octet-stream;     log_format  main  '\\$remote_addr - \\$remote_user [\\$time_local] &quot;\\$request&quot; '                       '\\$status \\$body_bytes_sent &quot;\\$http_referer&quot; '                       '&quot;\\$http_user_agent&quot; &quot;\\$http_x_forwarded_for&quot;';     access_log  \/var\/log\/nginx\/access.log  main;     sendfile        on;     client_max_body_size ${UPLOAD_MAX_FILESIZE};     keepalive_timeout  65;     # gzip settings     include ${NGINX_CONF_DIR}\/gzip_compression.conf;     # Cache settings     proxy_cache_path \/var\/cache\/nginx\/proxy         levels=1:2         keys_zone=wp_cache:10m         max_size=10g         inactive=60m         use_temp_path=off;     include ${NGINX_CONF_DIR}\/conf.d\/*.conf; } EOM<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h3 id=\"nastroyka-szhatiya-nginx\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0436\u0430\u0442\u0438\u044f NGINX<\/h3>\n<p>  <\/p>\n<p>\u0421\u0436\u0430\u0442\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043d\u0430 \u043b\u0435\u0442\u0443 \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0435\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u0430\u0439\u0442\u0430, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0441\u0436\u0430\u0442\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u042d\u0442\u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 <a href=\"https:\/\/github.com\/h5bp\/server-configs-nginx\/blob\/master\/h5bp\/web_performance\/compression.conf\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">cat &gt; ${NGINX_CONF_DIR}\/gzip_compression.conf &lt;&lt; 'EOM' # Credit: https:\/\/github.com\/h5bp\/server-configs-nginx\/ # ---------------------------------------------------------------------- # | Compression                                                        | # ---------------------------------------------------------------------- # https:\/\/nginx.org\/en\/docs\/http\/ngx_http_gzip_module.html # Enable gzip compression. # Default: off gzip on; # Compression level (1-9). # 5 is a perfect compromise between size and CPU usage, offering about 75% # reduction for most ASCII files (almost identical to level 9). # Default: 1 gzip_comp_level 6; # Don't compress anything that's already small and unlikely to shrink much if at # all (the default is 20 bytes, which is bad as that usually leads to larger # files after gzipping). # Default: 20 gzip_min_length 256; # Compress data even for clients that are connecting to us via proxies, # identified by the &quot;Via&quot; header (required for CloudFront). # Default: off gzip_proxied any; # Tell proxies to cache both the gzipped and regular version of a resource # whenever the client's Accept-Encoding capabilities header varies; # Avoids the issue where a non-gzip capable client (which is extremely rare # today) would display gibberish if their proxy gave them the gzipped version. # Default: off gzip_vary on; # Compress all output labeled with one of the following MIME-types. # `text\/html` is always compressed by gzip module. # Default: text\/html gzip_types   application\/atom+xml   application\/geo+json   application\/javascript   application\/x-javascript   application\/json   application\/ld+json   application\/manifest+json   application\/rdf+xml   application\/rss+xml   application\/vnd.ms-fontobject   application\/wasm   application\/x-web-app-manifest+json   application\/xhtml+xml   application\/xml   font\/eot   font\/otf   font\/ttf   image\/bmp   image\/svg+xml   text\/cache-manifest   text\/calendar   text\/css   text\/javascript   text\/markdown   text\/plain   text\/xml   text\/vcard   text\/vnd.rim.location.xloc   text\/vtt   text\/x-component   text\/x-cross-domain-policy; EOM<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h3 id=\"nastroyka-nginx-dlya-wordpress\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 NGINX \u0434\u043b\u044f WordPress<\/h3>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f WordPress <strong>default.conf<\/strong> \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <strong>conf.d<\/strong>. \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 TLS, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043e\u0442 Let&#8217;s Encrypt \u0447\u0435\u0440\u0435\u0437 Certbot (\u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435)<\/li>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 TLS, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u0445 \u043e\u0442 Let&#8217;s Encrypt<\/li>\n<li>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 1 \u0447\u0430\u0441 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/li>\n<li>\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a, \u0435\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d, \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u043e\u0431\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432: favicon.ico \u0438 robots.txt<\/li>\n<li>\u0417\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c <strong>.php<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435\u043b\u0435\u0433\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0435\u0434\u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a<\/li>\n<li>\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u043a\u0438 \u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0448\u0440\u0438\u0444\u0442\u043e\u0432<\/li>\n<li>\u0417\u0430\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 <a href=\"https:\/\/stackoverflow.com\/questions\/5008944\/how-to-add-an-access-control-allow-origin-header\">Access-Control-Allow-Origin<\/a> \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0448\u0440\u0438\u0444\u0442\u043e\u0432<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f index.php \u0438 \u043f\u0440\u043e\u0447\u0435\u0439 \u0441\u0442\u0430\u0442\u0438\u043a\u0438.<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">cat &gt; ${NGINX_CONF_DIR}\/conf.d\/default.conf &lt;&lt; EOM upstream unit_php_upstream {     server 127.0.0.1:8080;     keepalive 32; } server {     listen 80;     listen [::]:80;     # ACME-challenge used by Certbot for Let's Encrypt     location ^~ \/.well-known\/acme-challenge\/ {       root \/var\/www\/certbot;     }     location \/ {       return 301 https:\/\/${TLS_HOSTNAME}\\$request_uri;     } } server {     listen      443 ssl http2;     listen [::]:443 ssl http2;     server_name ${TLS_HOSTNAME};     root        \/var\/www\/wordpress\/;     # Let's Encrypt configuration     ssl_certificate         ${CERT_DIR}\/fullchain.pem;     ssl_certificate_key     ${CERT_DIR}\/privkey.pem;     ssl_trusted_certificate ${CERT_DIR}\/chain.pem;     include ${NGINX_CONF_DIR}\/options-ssl-nginx.conf;     ssl_dhparam ${NGINX_CONF_DIR}\/ssl-dhparams.pem;     # OCSP stapling     ssl_stapling on;     ssl_stapling_verify on;     # Proxy caching     proxy_cache wp_cache;     proxy_cache_valid 200 302 1h;     proxy_cache_valid 404 1m;     proxy_cache_revalidate on;     proxy_cache_background_update on;     proxy_cache_lock on;     proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;     location = \/favicon.ico {         log_not_found off;         access_log off;     }     location = \/robots.txt {         allow all;         log_not_found off;         access_log off;     }      # Deny all attempts to access hidden files such as .htaccess, .htpasswd,     # .DS_Store (Mac)     # Keep logging the requests to parse later (or to pass to firewall utilities     # such as fail2ban)     location ~ \/\\. {         deny all;     }     # Deny access to any files with a .php extension in the uploads directory;     # works in subdirectory installs and also in multi-site network.     # Keep logging the requests to parse later (or to pass to firewall utilities     # such as fail2ban).     location ~* \/(?:uploads|files)\/.*\\.php\\$ {         deny all;     }     # WordPress: deny access to wp-content, wp-includes PHP files     location ~* ^\/(?:wp-content|wp-includes)\/.*\\.php\\$ {         deny all;     }     # Deny public access to wp-config.php     location ~* wp-config.php {         deny all;     }     # Do not log access for static assets, media     location ~* \\.(?:css(\\.map)?|js(\\.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$ {         access_log off;     }     location ~* \\.(?:svgz?|ttf|ttc|otf|eot|woff2?)$ {         add_header Access-Control-Allow-Origin &quot;*&quot;;         access_log off;     }     location \/ {         try_files \\$uri @index_php;     }     location @index_php {         proxy_socket_keepalive on;         proxy_http_version 1.1;         proxy_set_header Connection &quot;&quot;;         proxy_set_header X-Real-IP \\$remote_addr;         proxy_set_header X-Forwarded-For \\$proxy_add_x_forwarded_for;         proxy_set_header X-Forwarded-Proto \\$scheme;         proxy_set_header Host \\$host;         proxy_pass       http:\/\/unit_php_upstream;     }     location ~* \\.php\\$ {         proxy_socket_keepalive on;         proxy_http_version 1.1;         proxy_set_header Connection &quot;&quot;;         proxy_set_header X-Real-IP \\$remote_addr;         proxy_set_header X-Forwarded-For \\$proxy_add_x_forwarded_for;         proxy_set_header X-Forwarded-Proto \\$scheme;         proxy_set_header Host \\$host;         try_files        \\$uri =404;         proxy_pass       http:\/\/unit_php_upstream;     } } EOM<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"nastroyka-certbot-dlya-sertifikatov-ot-lets-encrypt-i--ih-avtomaticheskoe-prodlenie\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Certbot \u0434\u043b\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u043e\u0442 Let&#8217;s Encrypt \u0438 \u0438\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u043e\u0434\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/certbot.eff.org\/about\/\">Certbot<\/a> \u2014 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043e\u0442 Electronic Frontier Foundation (EFF), \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b TLS \u043e\u0442 Let&#8217;s Encrypt. \u0421\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0449\u0438\u0435 \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Certbot \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u043e\u0442 Let&#8217;s Encrypt \u0432 NGINX:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 NGINX<\/li>\n<li>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b TLS<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 Certbot, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430<\/li>\n<li>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 NGINX \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432<\/li>\n<li>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a Certbot \u0432 3:24 \u043d\u043e\u0447\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435, \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 NGINX.<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">echo &quot; Stopping NGINX in order to set up Let's Encrypt&quot; service nginx stop  mkdir -p \/var\/www\/certbot chown www-data:www-data \/var\/www\/certbot chmod g+s \/var\/www\/certbot  if [ ! -f ${NGINX_CONF_DIR}\/options-ssl-nginx.conf ]; then   echo &quot; Downloading recommended TLS parameters&quot;   curl --retry 6 -Ls -z &quot;Tue, 14 Apr 2020 16:36:07 GMT&quot; \\     -o &quot;${NGINX_CONF_DIR}\/options-ssl-nginx.conf&quot; \\     &quot;https:\/\/raw.githubusercontent.com\/certbot\/certbot\/master\/certbot-nginx\/certbot_nginx\/_internal\/tls_configs\/options-ssl-nginx.conf&quot; \\     || echo &quot;Couldn't download latest options-ssl-nginx.conf&quot; fi  if [ ! -f ${NGINX_CONF_DIR}\/ssl-dhparams.pem ]; then   echo &quot; Downloading recommended TLS DH parameters&quot;   curl --retry 6 -Ls -z &quot;Tue, 14 Apr 2020 16:49:18 GMT&quot; \\     -o &quot;${NGINX_CONF_DIR}\/ssl-dhparams.pem&quot; \\     &quot;https:\/\/raw.githubusercontent.com\/certbot\/certbot\/master\/certbot\/certbot\/ssl-dhparams.pem&quot; \\     || echo &quot;Couldn't download latest ssl-dhparams.pem&quot; fi  # If tls_certs_init.sh hasn't been run before, remove the self-signed certs if [ ! -d &quot;\/etc\/letsencrypt\/accounts&quot; ]; then   echo &quot; Removing self-signed certificates&quot;   rm -rf &quot;${CERT_DIR}&quot; fi  if [ &quot;&quot; = &quot;${LETS_ENCRYPT_STAGING:-}&quot; ] || [ &quot;0&quot; = &quot;${LETS_ENCRYPT_STAGING}&quot; ]; then   CERTBOT_STAGING_FLAG=&quot;&quot; else   CERTBOT_STAGING_FLAG=&quot;--staging&quot; fi  if [ ! -f &quot;${CERT_DIR}\/fullchain.pem&quot; ]; then   echo &quot; Generating certificates with Let's Encrypt&quot;   certbot certonly --standalone \\          -m &quot;${WORDPRESS_ADMIN_EMAIL}&quot; \\          ${CERTBOT_STAGING_FLAG} \\          --agree-tos --force-renewal --non-interactive \\          -d &quot;${TLS_HOSTNAME}&quot; fi  echo &quot; Starting NGINX in order to use new configuration&quot; service nginx start  # Write crontab for periodic Let's Encrypt cert renewal if [ &quot;$(crontab -l | grep -m1 'certbot renew')&quot; == &quot;&quot; ]; then   echo &quot; Adding certbot to crontab for automatic Let's Encrypt renewal&quot;   (crontab -l 2&gt;\/dev\/null; echo &quot;24 3 * * * certbot renew --nginx --post-hook 'service nginx reload'&quot;) | crontab - fi<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"dopolnitelnaya-nastroyka-vashego-sayta\">\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430<\/h2>\n<p>  <\/p>\n<p>\u041c\u044b \u0432\u044b\u0448\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043d\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 NGINX \u0438 NGINX Unit \u0434\u043b\u044f \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u043a \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u0430\u0439\u0442\u0430 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c TLS\\SSL. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0442\u0430\u043a\u0436\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0430\u0448\u0438\u0445 \u043d\u0443\u0436\u0434, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 <a href=\"https:\/\/github.com\/google\/ngx_brotli\">Brotli<\/a>, \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u043e\u0435 \u0441\u0436\u0430\u0442\u0438\u0435 \u043d\u0430 \u043b\u0435\u0442\u0443 \u043f\u043e HTTPS<\/li>\n<li><a href=\"https:\/\/github.com\/SpiderLabs\/ModSecurity-nginx\">ModSecurity<\/a> \u0441 <a href=\"https:\/\/github.com\/Rev3rseSecurity\/wordpress-modsecurity-ruleset\">\u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438 \u0434\u043b\u044f WordPress<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0442\u0430\u043a\u0438 \u043d\u0430 \u0432\u0430\u0448 \u0441\u0430\u0439\u0442<\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/449282\/\">\u0420\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/a> \u0434\u043b\u044f WordPress, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0432\u0430\u043c<\/li>\n<li><a href=\"https:\/\/www.inguardians.com\/2017\/06\/08\/protecting-the-mr-robot-vuln-hub-machine-part-2-confining-wordpress-with-apparmor\/\">\u0417\u0430\u0449\u0438\u0442\u0443<\/a> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/wiki.ubuntu.com\/AppArmor\">AppArmor<\/a> (\u043d\u0430 Ubuntu)<\/li>\n<li>Postfix \u0438\u043b\u0438 msmtp, \u0447\u0442\u043e\u0431\u044b WordPress \u043c\u043e\u0433 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0447\u0442\u0443<\/li>\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u043b\u0438, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0435\u0440\u0436\u0430\u0442\u044c<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u043b\u0443\u0447\u0448\u0435\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u0430\u0439\u0442\u0430 \u043c\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0434\u043e <a href=\"https:\/\/www.nginx.com\/products\/nginx\">NGINX Plus<\/a>, \u043d\u0430\u0448 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 NGINX c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0415\u0433\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c Brotli, \u0430 \u0442\u0430\u043a\u0436\u0435 (\u0437\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u043f\u043b\u0430\u0442\u0443) <a href=\"https:\/\/www.nginx.com\/products\/nginx\/modules\/nginx-waf\/\">NGINX ModSecurity WAF<\/a>. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c <a href=\"https:\/\/www.nginx.com\/products\/nginx-app-protect\/\">NGINX App Protect<\/a>, \u043c\u043e\u0434\u0443\u043b\u044c WAF \u0434\u043b\u044f NGINX Plus, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u0432\u0435\u0434\u0443\u0449\u0435\u0439 \u0432 \u043e\u0442\u0440\u0430\u0441\u043b\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043e\u0442 F5.<\/p>\n<p>  <\/p>\n<blockquote><p><strong>N.B.<\/strong> \u0417\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c <a href=\"https:\/\/southbridge.io\/?utm_source=habr&amp;utm_medium=promo&amp;utm_campaign=southbridge&amp;utm_content=post_23-20-2020&amp;utm_term=demkovich\">Southbridge<\/a>. \u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u043c \u0431\u044b\u0441\u0442\u0440\u0443\u044e \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0438\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u0434 \u043b\u044e\u0431\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439.<\/p><\/blockquote>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/524660\/\"> https:\/\/habr.com\/ru\/company\/southbridge\/blog\/524660\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dd\/uo\/ka\/dduokadhwhdzg4drs-0vs2lt4vg.png\"><\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 WordPress, \u043f\u043e\u0438\u0441\u043a \u0432 Google \u043f\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u0430\u043c &quot;WordPress install&quot; \u0432\u044b\u0434\u0430\u0441\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u043f\u043e\u043b\u0443\u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. \u041d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u0432\u0435\u0441\u044c\u043c\u0430 \u043c\u0430\u043b\u043e \u0433\u043e\u0434\u043d\u044b\u0445 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c WordPress \u0438 \u043d\u0438\u0436\u0435\u043b\u0435\u0436\u0430\u0449\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439, \u0438\u043b\u0438 \u0436\u0435 \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u044c\u044e \u0442\u044f\u0436\u0435\u043b\u043e\u0439 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435\u0435 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 bash \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 WordPress \u043d\u0430 Ubuntu, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u043d\u0435\u043c\u0443, \u043f\u043e\u044f\u0441\u043d\u044f\u044f, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0435\u0433\u043e \u043a\u0443\u0441\u043e\u0447\u0435\u043a, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430 \u043a\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u044b \u043c\u044b \u043f\u043e\u0448\u043b\u0438 \u043f\u0440\u0438 \u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u2014 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e <a href=\"https:\/\/gist.github.com\/nginx-gists\/bdc7da70b124c4f3e472970c7826cccc\">\u0432\u0437\u044f\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442<\/a> \u0434\u043b\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0432\u0430\u0448\u0438\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Wordpress \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 Lets Encrypt, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0430\u044f \u043d\u0430 NGINX Unit \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u0430\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-311915","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=311915"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311915\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=311915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=311915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=311915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}