{"id":335168,"date":"2022-06-30T15:00:31","date_gmt":"2022-06-30T15:00:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=335168"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=335168","title":{"rendered":"<span>\u041f\u0440\u043e Ansible \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432: \u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 (\u0447\u0430\u0441\u0442\u044c II)<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/fc5\/aea\/c2e\/fc5aeac2e6320674701366acf0cae0dc.jpg\" width=\"1280\" height=\"762\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fc5\/aea\/c2e\/fc5aeac2e6320674701366acf0cae0dc.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u043b\u043e \u0435\u0433\u043e  \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c. \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u0446\u0438\u043a\u043b\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/645451\/\">\u0432\u043e\u0442<\/a>, <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/661443\/\">\u0432\u043e\u0442<\/a>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c Ansible role \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/668458\/\">\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>, \u043b\u044e\u0431\u043e\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 ansible-\u0440\u043e\u043b\u0438 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u043d\u043e\u043c. \u0412 \u044d\u0442\u043e\u0442 \u043f\u043b\u0430\u043d \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0435, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0443\u043d\u043a\u0442\u044b \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0442\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u043c, &#8212; \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438. \u0412\u043e\u0442 \u043d\u0430\u0448 \u043f\u043b\u0430\u043d, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044b \u043f\u0435\u0440\u0432\u044b\u0435 \u0442\u0440\u0438 \u043f\u0443\u043d\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/668458\/\">\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>:<\/p>\n<ol>\n<li>\n<p><s>\u041f\u0443\u043d\u043a\u0442 1. \u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/s><\/p>\n<\/li>\n<li>\n<p><s>\u041f\u0443\u043d\u043a\u0442 2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 LEMP.<\/s><\/p>\n<\/li>\n<li>\n<p><s>\u041f\u0443\u043d\u043a\u0442 3. \u041f\u0440\u0430\u0432\u0430 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/s><\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u043d\u043a\u0442 4. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 LEMP.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u043d\u043a\u0442 5. \u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u043a\u043e\u0434\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438 \u0438 \u0411\u0414.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u043d\u043a\u0442 6. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u043d\u043a\u0442 7. \u0418\u0442\u043e\u0433.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0447\u0435\u0442\u044b\u0440\u0435 \u044d\u0442\u0430\u043f\u0430. \u0418\u0442\u0430\u043a, \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \/var\/ansible \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f:<\/p>\n<p>.<\/p>\n<p>\u251c\u2500\u2500 hosts.txt<\/p>\n<p>\u251c\u2500\u2500 LEMP<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 defaults<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 main.yml<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 files<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 handlers<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 main.yml<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 meta<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 main.yml<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 README.md<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 tasks<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 apache2_install.yml<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 default_settings.yml<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 default_user_settings.yml<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 exim4_install.yml<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 main.yml<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 mysql_install.yml<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 nginx_install.yml<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 templates<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 tests<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 inventory<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 test.yml<\/p>\n<p>\u2502 \u00a0 \u2514\u2500\u2500 vars<\/p>\n<p>\u2502 \u00a0 \u00a0 \u00a0 \u2514\u2500\u2500 main.yml<\/p>\n<p>\u2514\u2500\u2500 playbook.yml<\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 4. \u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/h3>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>php<\/p>\n<\/li>\n<li>\n<p>nginx<\/p>\n<\/li>\n<li>\n<p>mysql<\/p>\n<\/li>\n<li>\n<p>apache2<\/p>\n<\/li>\n<li>\n<p>exim4<\/p>\n<\/li>\n<\/ol>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 php.<\/h4>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c php \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u043e\u0439 \u0444\u0430\u0439\u043b \u0432 <code>\/var\/ansible\/LEMP\/tasks<\/code> \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c php.yml. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.ansible.com\/ansible\/2.5\/modules\/apt_module.html\">apt<\/a>.<\/p>\n<pre><code>cd \/var\/ansible\/LEMP\/tasks touch php.yml<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code>- name: install php \u00a0\u00a0apt: name={{ item }} update_cache=yes state=latest \u00a0\u00a0with_items: \u00a0\u00a0- git \u00a0\u00a0- php \u00a0\u00a0- php-curl \u00a0\u00a0- php-gd \u00a0\u00a0- php-mbstring \u00a0\u00a0- php-xml \u00a0\u00a0- php-xmlrpc \u00a0\u00a0- php-soap \u00a0\u00a0- php-intl \u00a0\u00a0- php-zip<\/code><\/pre>\n<ol>\n<li>\n<p><a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/user_guide\/playbooks_loops.html\">with_items<\/a>: &#8212; \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043d\u0430\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>name={{ item }} &#8212; \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 item \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 php \u043c\u043e\u0434\u0443\u043b\u0435\u0439. apt \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 item.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 yml-\u0444\u0430\u0439\u043b \u0432 main.yml.<\/p>\n<p>\u0412 main.yml \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c.<\/p>\n<pre><code>#####install php \u00a0\u00a0- include_tasks: php.yml<\/code><\/pre>\n<p>\u0414\u043b\u044f php \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c php.ini \u0444\u0430\u0439\u043b.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e php \u0438 \u0444\u0430\u0439\u043b php-ansible.ini \u0432 <code>\/var\/ansible\/LEMP\/files\/<\/code>.<\/p>\n<pre><code>cd\u00a0\/var\/ansible\/LEMP\/files\/ mkdir php touch php\/php.ini<\/code><\/pre>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0444\u0430\u0439\u043b php-ansible.ini, \u043f\u043e\u0441\u043b\u0435 [PHP], \u043b\u044e\u0431\u0443\u044e\u00a0\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0432\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code>[PHP]  <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432 <code>\/etc\/php\/7.3\/apache2\/<\/code>. \u041e\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 php. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e apache2.<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b php.yml \u0432 \u0437\u0430\u0434\u0430\u043d\u0438\u044f\u0445 <code>(\/var\/ansible\/LEMP\/tasks\/php.yml)<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 apache2.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code>- name: copy config \u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0src: php\/php-ansible.ini \u00a0\u00a0\u00a0\u00a0dest: \/etc\/php\/7.3\/apache2  - name: restart apache2 \u00a0\u00a0service: \u00a0\u00a0\u00a0\u00a0name: apache2 \u00a0\u00a0\u00a0\u00a0state: restarted<\/code><\/pre>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 nginx.<\/h4>\n<ol>\n<li>\n<p>\u0414\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b\u00a0nginx:<\/p>\n<ol>\n<li>\n<p>nginx.conf;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438. domain_name.conf.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c nginx.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>\/var\/ansible\/LEMP\/files<\/code>.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e nginx.<\/p>\n<pre><code>mkdir nginx cd nginx\/<\/code><\/pre>\n<p>\u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 nginx \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c 2 \u0444\u0430\u0439\u043b\u0430: <strong>nginx.conf<\/strong> \u0438 <strong>domain_name.conf<\/strong>.<\/p>\n<pre><code>touch nginx.conf domain_name.conf<\/code><\/pre>\n<ol>\n<li>\n<p>nginx.conf  \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e nginx<\/p>\n<\/li>\n<li>\n<p>domain_name.conf\u00a0\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 sites-available.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 nginx.conf \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/646023\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439\u00a0\u0441\u0442\u0430\u0442\u044c\u0438<\/a>.<\/p>\n<p>\u0412 domain_name.conf \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/646545\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/a>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 <code>.\/tasks\/nginx_install.yml<\/code>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/docs.ansible.com\/ansible\/2.5\/modules\/copy_module.html\">copy<\/a> \u0438 <a href=\"https:\/\/docs.ansible.com\/ansible\/2.5\/modules\/file_module.html\">file<\/a>.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code>\u00a0\u00a0- name: Copy config. \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: nginx\/nginx.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/nginx\/nginx.conf  \u00a0\u00a0- name: Copy domain_name\u00a0 config \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: nginx\/domain_name.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/nginx\/sites-available\/domain_name.conf  \u00a0\u00a0- name: enable site domain_name \u00a0\u00a0\u00a0\u00a0file: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: \/etc\/nginx\/sites-available\/domain_name.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/nginx\/sites-enabled\/domain_name.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: link  \u00a0\u00a0- name: restart nginx \u00a0\u00a0\u00a0\u00a0service: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: nginx \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: restarted<\/code><\/pre>\n<ol>\n<li>\n<p>src &#8212; \u0444\u0430\u0439\u043b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 .\/files;<\/p>\n<\/li>\n<li>\n<p>dest &#8212; \u0430\u0434\u0440\u0435\u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<\/p>\n<pre><code>TASK [LEMP : include_tasks] ************************************************************************************************************************************************************************************* included: \/var\/ansible\/LEMP\/tasks\/nginx_install.yml for ansible2 TASK [LEMP : Install nginx] ************************************************************************************************************************************************************************************* ok: [ansible2] TASK [LEMP : Copy config.] ************************************************************************************************************************************************************************************** changed: [ansible2] TASK [LEMP : Copy domain_name\u00a0 config] ************************************************************************************************************************************************************************** changed: [ansible2] TASK [LEMP : enable site domain_name] *************************************************************************************************************************************************************************** changed: [ansible2] PLAY RECAP ****************************************************************************************************************************************************************************************************** ansible2 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 : ok=4\u00a0 \u00a0 changed=3\u00a0 \u00a0 unreachable=0\u00a0 \u00a0 failed=0<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f nginx \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430.\u00a0<\/p>\n<p>\u0418\u0442\u043e\u0433:<\/p>\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f nginx \u0438 domain_name.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u0432 sites-enabled.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 mysql.<\/h4>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b mysql.cnf, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e mysql \u0432 <code>\/var\/ansible\/LEMP\/files<\/code>.<\/p>\n<pre><code>cd \/var\/ansible\/LEMP\/files mkdir mysql cd mysql\/ touch mysql.cnf<\/code><\/pre>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435 [mysqld] \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0432\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<\/p>\n<pre><code>[mysqld] <\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 ansible mysql <code>\/var\/ansible\/LEMP\/tasks\/mysql_install.yml<\/code><\/p>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c mysql.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code>\u00a0\u00a0- name: Copy config \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: mysql\/mysql.cnf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/mysql\/mysql.conf.d\/mysql.cnf  \u00a0\u00a0- name: restart mysql \u00a0\u00a0\u00a0\u00a0service: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: mysql \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: restarted<\/code><\/pre>\n<p>\u0418\u0442\u043e\u0433:<\/p>\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 mysql.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 mysql \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 apache2.<\/h4>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043a\u0430\u043a \u0438 \u0443 nginx<\/p>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c<\/p>\n<ol>\n<li>\n<p>apache2.conf<\/p>\n<\/li>\n<li>\n<p>domain_name.conf<\/p>\n<\/li>\n<li>\n<p>ports.conf<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0438 \u0432\u044b\u0448\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>\/var\/ansible\/LEMP\/files<\/code>.<\/p>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f apache2 \u0438 domain_name \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439:<\/p>\n<ol>\n<li>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u00a0<a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/646023\/\">apache2.conf<\/a><\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u00a0<a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/646545\/\">domain_name.conf<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 apache2 \u043d\u0430 81 \u043f\u043e\u0440\u0442\u0443. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e\u00a0\u0434\u043b\u044f ports.conf:<\/p>\n<pre><code>Listen 81 &lt;IfModule ssl_module> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Listen 443 &lt;\/IfModule>  &lt;IfModule mod_gnutls.c> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Listen 443 &lt;\/IfModule><\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u043c \u0432 <code>\/var\/ansible\/LEMP\/tasks\/apache2_install.yml<\/code><\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code>\u00a0- name: copy config \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: apache2\/apache2.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/apache2\/apache2.conf  \u00a0\u00a0- name: copy domain_name config \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: apache2\/domain_name.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/apache2\/sites-available\/domain_name.conf  \u00a0\u00a0- name: enable site domain_name \u00a0\u00a0\u00a0\u00a0file: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: \/etc\/apache2\/sites-available\/domain_name.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/apache2\/sites-enabled\/domain_name.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: link  \u00a0\u00a0- name: copy ports \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: apache2\/ports.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/apache2\/ports.conf  \u00a0\u00a0- name: restart apache2 \u00a0\u00a0\u00a0\u00a0service: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: apache2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: restarted<\/code><\/pre>\n<p>\u0418\u0442\u043e\u0433:<\/p>\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 apache2.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 exim4.<\/h4>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e:<\/p>\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 <code>\/etc\/exim4\/update-exim4.conf.conf<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c exim4.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e exim4 \u0438 \u0444\u0430\u0439\u043b update-exim4.conf.conf \u0432 <code>\/var\/ansible\/LEMP\/files<\/code>.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 exim4:<\/p>\n<pre><code># \/etc\/exim4\/update-exim4.conf.conf # # Edit this file and \/etc\/mailname by hand and execute update-exim4.conf # yourself or use 'dpkg-reconfigure exim4-config' # # Please note that this is _not_ a dpkg-conffile and that automatic changes # to this file might happen. The code handling this will honor your local # changes, so this is usually fine, but will break local schemes that mess # around with multiple versions of the file. # # update-exim4.conf uses this file to determine variable values to generate # exim configuration macros for the configuration file. # # Most settings found in here do have corresponding questions in the # Debconf configuration, but not all of them. # # This is a Debian specific file dc_eximconfig_configtype='local' dc_other_hostnames='domain_name' dc_local_interfaces='127.0.0.1 ; ::1' dc_readhost='' dc_relay_domains='' dc_minimaldns='false' dc_relay_nets='' dc_smarthost='' CFILEMODE='644' dc_use_split_config='false' dc_hide_mailname='' dc_mailname_in_oh='true' dc_localdelivery='mail_spool'<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 <code>(\/var\/ansible\/LEMP\/tasks\/exim4_install.yml)<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c &#171;\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430&#187; \u0438 &#171;\u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 exim4&#187;.<\/p>\n<pre><code>\u00a0\u00a0- name: copy config \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: exim4\/update-exim4.conf.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/exim4\/update-exim4.conf.conf  \u00a0\u00a0- name: restart exim4 \u00a0\u00a0\u00a0\u00a0service: \u00a0\u00a0\u00a0\u00a0 \u00a0name: exim4 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: restarted<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f exim4 \u0433\u043e\u0442\u043e\u0432\u0430.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 files \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439:<\/p>\n<p>\u251c\u2500\u2500 files<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 apache2<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 apache2.conf<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 domain_name.conf<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 ports.conf<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 exim4<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 update-exim4.conf.conf<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 mysql<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 mysql.cnf<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 nginx<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 domain_name.conf<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 nginx.conf<\/p>\n<p>\u2502 \u00a0 \u2514\u2500\u2500 php<\/p>\n<p>\u2502 \u00a0 \u00a0 \u00a0 \u2514\u2500\u2500 php-ansible.ini<\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430. \u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u0438\u0445 \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e \u0432\u044b\u0448\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443.<\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 5. \u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u043a\u043e\u0434\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438 \u0438 \u0411\u0414.<\/h3>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0443\u043d\u043a\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c dump \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u0411\u0414 \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043a\u043e\u0434 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438.<\/p>\n<p>\u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f 2 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 files.<\/p>\n<p>\u042d\u0442\u043e:<\/p>\n<ol>\n<li>\n<p>mysql_dump &#8212; \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0441 \u0434\u0430\u043c\u043f\u043e\u043c \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>data &#8212; \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0441 \u043a\u043e\u0434\u043e\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u0434 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>\/data<\/code>.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434\u043e\u043c \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a <a href=\"https:\/\/ru.wordpress.org\/download\/\">wordpress<\/a>.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0434\u0430\u043c\u043f \u0432\u0430\u0448\u0435\u0439 \u0411\u0414 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>\/mysql_dump<\/code>.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 yml-\u0444\u0430\u0439\u043b \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c file.yml \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>\/var\/ansible\/LEMP\/tasks\/<\/code>.<\/p>\n<p>\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0435\u0433\u043e \u0432 main.yml<\/p>\n<pre><code>\u00a0\u00a0####add_site_file   - include_tasks: file.yml<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u0435:<\/p>\n<pre><code>\u00a0\u00a0- name: copy file domain_name \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: data\/ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/var\/www\/domain_name\/data\/ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0owner: domain_name \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0group: domain_name  \u00a0\u00a0- name: copy dump \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: mysql_dump\/dump.sql \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/tmp\/dump.sql  \u00a0\u00a0- name: mysql_dump \u00a0\u00a0\u00a0\u00a0mysql_db: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: domain_name_db \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: import \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0target: \/tmp\/dump.sql \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0login_user: root \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0login_password: \"{{ mysql_root_password }}\"<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043c\u043f \u0432 \u0411\u0414, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c mysql_db.<\/p>\n<p>\u0424\u0430\u0439\u043b\u044b \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438 \u0438 \u0434\u0430\u043c\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 6. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/h3>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/>.<br \/>\u251c\u2500\u2500 hosts.txt<br \/>\u251c\u2500\u2500 LEMP<br \/>\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 defaults<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 main.yml<br \/>\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 files<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 apache2<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 apache2.conf<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 domain_name.conf<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 ports.conf<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 data<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 exim4<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 update-exim4.conf.conf<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 mysql<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 mysql.cnf<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 mysql_dump<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 dump.sql<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 nginx<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 domain_name.conf<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 nginx.conf<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 php<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0 \u00a0 \u00a0\u2514\u2500\u2500 php-ansible.ini<br \/>\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 handlers<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 main.yml<br \/>\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 meta<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 main.yml<br \/>\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 README.md<br \/>\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 tasks<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 apache2_install.yml<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 default_settings.yml<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 default_user_settings.yml<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 exim4_install.yml<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 file.yml<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 main.yml<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 mysql_install.yml<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 nginx_install.yml<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 php.yml<br \/>\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 templates<br \/>\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 tests<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u251c\u2500\u2500 inventory<br \/>\u2502\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 test.yml<br \/>\u2502\u00a0\u00a0\u00a0\u2514\u2500\u2500 vars<br \/>\u2502\u00a0\u00a0\u00a0 \u00a0 \u00a0\u2514\u2500\u2500 main.yml<br \/>\u251c\u2500\u2500 php.ini<br \/>\u251c\u2500\u2500 playbook.retry<br \/>\u2514\u2500\u2500 playbook.yml<\/p>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 .tasks:<\/p>\n<p><strong>apache2_install.yml<\/strong>:<\/p>\n<pre><code>  - name: Install apache2     apt:       name: apache2       state: latest    - name: copy config     copy:       src: apache2\/apache2.conf       dest: \/etc\/apache2\/apache2.conf    - name: copy domain_name config     copy:       src: apache2\/domain_name.conf       dest: \/etc\/apache2\/sites-available\/domain_name.conf    - name: copy ports     copy:       src: apache2\/ports.conf       dest: \/etc\/apache2\/ports.conf    - name: restart apache2     service:       name: apache2       state: restarted<\/code><\/pre>\n<p><strong>default_settings.yml<\/strong>:<\/p>\n<pre><code>  - name: update repo.     shell: apt update    - name: install default app.     shell:       cmd: \"apt install -y dirmngr mc iotop htop telnet tcpdump nmap curl hexedit sudo zip unzip patch pwgen vim less parted subversion ntp bzip2 lsof strace mutt s-nail ncdu smartmontools tree dnsutils logrotate rsyslog\"    - name: time     shell:       cmd: \"timedatectl set-timezone {{time_zone}}\"    - name: locale settings     shell:       cmd: 'locale-gen {{locale1}} &amp;&amp; update-locale LANG={{locale2}} LC_TIME=\"{{locale1}}\"'    - name: hostname     shell:       cmd: \"hostnamectl set-hostname {{DOMAIN_NAME}}\"<\/code><\/pre>\n<p><strong>default_user_settings.yml<\/strong>:<\/p>\n<pre><code>  - name: add group     group:       name: \"{{ DOMAIN_NAME }}\"       state: present       gid: \"{{ Group_GID }}\"    - name: add user     user:       name: \"{{ DOMAIN_NAME }}\"       password: \"{{ user_password | password_hash('sha512') }}\"       uid: \"{{ User_uid }}\"       group: \"{{ DOMAIN_NAME }}\"       state: present       update_password: on_create       home: \"\/var\/www\/{{ DOMAIN_NAME }}\"       shell: \/bin\/bash    - name: create home directory     file:       path: \"\/var\/www\/{{ DOMAIN_NAME }}\"       owner: \"{{ DOMAIN_NAME }}\"       group: \"{{ DOMAIN_NAME }}\"       mode: 0751       state: directory    - name: create other directory     file:       path: \"\/var\/www\/{{ DOMAIN_NAME }}\/data\"       owner: \"{{ DOMAIN_NAME }}\"       group: \"{{ DOMAIN_NAME }}\"       mode: 0755       state: directory    - name: create other directory     file:       path: \"\/var\/www\/{{ DOMAIN_NAME }}\/log\"       owner: \"{{ DOMAIN_NAME }}\"       group: \"{{ DOMAIN_NAME }}\"       mode: 0755       state: directory    - name: create other directory     file:       path: \"\/var\/www\/{{ DOMAIN_NAME }}\/sess\"       owner: \"{{ DOMAIN_NAME }}\"       group: \"{{ DOMAIN_NAME }}\"       mode: 0755       state: directory    - name: create other directory     file:       path: \"\/var\/www\/{{ DOMAIN_NAME }}\/tmp\"       owner: \"{{ DOMAIN_NAME }}\"       group: \"{{ DOMAIN_NAME }}\"       mode: 0755       state: directory    - name: create other directory     file:       path: \"\/var\/www\/{{ DOMAIN_NAME }}\/upload\"       owner: \"{{ DOMAIN_NAME }}\"       group: \"{{ DOMAIN_NAME }}\"       mode: 0755       state: directory    - name: create other directory     file:       path: \"\/var\/www\/{{ DOMAIN_NAME }}\/log\/apache2\"       owner: \"{{ DOMAIN_NAME }}\"       group: \"{{ DOMAIN_NAME }}\"       mode: 0755       state: directory    - name: create other directory     file:       path: \"\/var\/www\/{{ DOMAIN_NAME }}\/log\/nginx\"       owner: \"{{ DOMAIN_NAME }}\"       group: \"{{ DOMAIN_NAME }}\"       mode: 0755       state: directory<\/code><\/pre>\n<p><strong>exim4_install.yml<\/strong>:<\/p>\n<pre><code>  - name: Install exim4     apt:       name: exim4       state: latest    - name: copy config     copy:       src: exim4\/update-exim4.conf.conf       dest: \/etc\/exim4\/update-exim4.conf.conf    - name: restart exim4     service:       name: exim4       state: restarted<\/code><\/pre>\n<p><strong>main.yml<\/strong>:<\/p>\n<pre><code>#  - include_tasks: default_settings.yml   #####install mysql #  - include_tasks: mysql_install.yml   #####install nginx #  - include_tasks: nginx_install.yml   #####install apache2 #  - include_tasks: apache2_install.yml   #####install exim4 #  - include_tasks: exim4_install.yml   #####default user settings #  - include_tasks: default_user_settings.yml   #####install php #  - include_tasks: php.yml   #####copy file domain_name   - include_tasks: file.yml<\/code><\/pre>\n<p><strong>mysql_install.yml:<\/strong><\/p>\n<pre><code>  - name: add mysql repo     get_url:       url: https:\/\/dev.mysql.com\/get\/mysql-apt-config_0.8.6-1_all.deb       dest: \"\/tmp\"       mode: 0440    - name: install mysql repo     apt: \"deb=\/tmp\/mysql-apt-config_0.8.6-1_all.deb\"     become: true    - name: add key mysql and update repo     shell: \"apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29 &amp;&amp; apt update\"    - name: install python-mysqldb     apt:       name: python-mysqldb       state: present       update_cache: yes    - name: check latest version of mysql 5.7     command: bash -c \"apt-cache showpkg mysql-server|grep 5.7|head -1|cut -d' ' -f1\"     register: latestmysql57   - debug: msg=\"{{ latestmysql57.stdout }}\"    - name: install mysql 57     apt:       name: mysql-server={{ latestmysql57.stdout }}       state: present       update_cache: yes    - name: update mysql root password for all root accounts     become: true     mysql_user:       name: root       host: \"{{ item }}\"       password: \"{{ mysql_root_password }}\"       login_user: root       login_password: 12345       check_implicit_admin: yes       priv: \"*.*:ALL,GRANT\"       state: present     with_items:       - 127.0.0.1       - ::1       - localhost    - name: Create a new database with name 'DOMAIN_NAME_DB'     mysql_db:       login_user: root       login_password: \"{{ mysql_root_password }}\"       name: \"{{name_db}}\"       state: present    - name: add user DOMAIN_NAME_USR     mysql_user:       login_user: root       login_password: \"{{ mysql_root_password }}\"       host: localhost       name: \"{{user_db}}\"       password: \"{{password_user_db}}\"       priv: '{{name_db}}.*:ALL,GRANT'       state: present    - name: Copy config     copy:       src: mysql\/mysql.cnf       dest: \/etc\/mysql\/mysql.conf.d\/mysql.cnf    - name: restart mysql     service:       name: mysql       state: restarted<\/code><\/pre>\n<p><strong>nginx_install.yml<\/strong>:<\/p>\n<pre><code>  - name: Install nginx     apt:       name: nginx       state: latest    - name: Copy config.     copy:       src: nginx\/nginx.conf       dest: \/etc\/nginx\/nginx.conf    - name: Copy domain_name  config     copy:       src: nginx\/domain_name.conf       dest: \/etc\/nginx\/sites-available\/domain_name.conf    - name: enable site domain_name     file:       src: \/etc\/nginx\/sites-available\/domain_name.conf       dest: \/etc\/nginx\/sites-enabled\/domain_name.conf       state: link    - name: restart nginx     service:       name: nginx       state: restarted<\/code><\/pre>\n<p><strong>php.yml<\/strong>:<\/p>\n<pre><code>- name: install php   apt: name={{ item }} update_cache=yes state=latest   with_items:   - git   - php   - php-curl   - php-gd   - php-mbstring   - php-xml   - php-xmlrpc   - php-soap   - php-intl   - php-zip  - name: copy config   copy:     src: php\/php-ansible.ini     dest: \/etc\/php\/7.3\/apache2  - name: restart apache2   service:     name: apache2     state: restarted<\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 <code>\/var\/ansible\/LEMP\/vars\/main.yml<\/code>:<\/p>\n<pre><code>DOMAIN_NAME: domain_name locale1: ru_RU.UTF-8 locale2: en_US.UTF-8 time_zone: Europe\/Moscow User_uid: 10000 Group_GID: 10000 user_password: password mysql_root_password: password name_db: domain_name_db user_db: domain_name_usr password_user_db: password<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 <code>\/etc\/hosts<\/code> \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0438\u0434\u0430:<\/p>\n<pre><code>127.0.0.1 domain_name.com<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432:<\/p>\n<pre><code>systemctl status nginx apache2 mysql exim4<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0430\u0439\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e curl.<\/p>\n<pre><code># curl -LI domain_name.com HTTP\/1.1 302 Found Server: nginx Date: Wed, 29 Jun 2022 11:32:10 GMT Content-Type: text\/html; charset=UTF-8 Connection: keep-alive Keep-Alive: timeout=15 Location: http:\/\/domain_name.com\/wp-admin\/setup-config.php  HTTP\/1.1 200 Server: nginx Date: Wed, 29 Jun 2022 11:32:10 GMT Content-Type: text\/html; charset=UTF-8 Connection: keep-alive Keep-Alive: timeout=15 Expires: Wed, 11 Jan 1984 05:00:00 GMT Cache-Control: no-cache, must-revalidate, max-age=0<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0443 \u0432 \u0432\u0435\u0431 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435.<\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 7. \u0418\u0442\u043e\u0433.<\/h3>\n<p>\u041d\u0443 \u0432\u043e\u0442 \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u0438 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 Ansible \u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0435. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0434\u0430\u043d\u043d\u0430\u044f \u0440\u043e\u043b\u044c ansible \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439, \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u042d\u0442\u043e\u0433\u043e \u043c\u0438\u043d\u0438-\u043a\u0443\u0440\u0441\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 ansible \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u0421\u0442\u0430\u0432\u044c\u0442\u0435 \u043b\u0430\u0439\u043a\u0438 \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u043d\u0430\u0441 &#8212; \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0431\u0443\u0434\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u0435\u0439.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u043d\u0430\u0448 telegram-\u043a\u0430\u043d\u0430\u043b\u00a0<a href=\"https:\/\/t.me\/devops_fm\">DevOps FM<\/a>.<\/p>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f:<\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/665126\/\">\u0417\u0430\u0448\u0438\u0442\u0430 \u043e\u0442 dos\/ddos.<\/a><\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/661443\/\">\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 docker.<\/a><\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/661233\/\">10 \u0447\u0430\u0441\u0442\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 nginx.<\/a><\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/645451\/\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 LEMP \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 \u043d\u0443\u043b\u044f.<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \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\/nixys\/blog\/674088\/\"> https:\/\/habr.com\/ru\/company\/nixys\/blog\/674088\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u043b\u043e \u0435\u0433\u043e  \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c. \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u0446\u0438\u043a\u043b\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/645451\/\">\u0432\u043e\u0442<\/a>, <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/661443\/\">\u0432\u043e\u0442<\/a>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c Ansible role \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/668458\/\">\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>, \u043b\u044e\u0431\u043e\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 ansible-\u0440\u043e\u043b\u0438 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u043d\u043e\u043c. \u0412 \u044d\u0442\u043e\u0442 \u043f\u043b\u0430\u043d \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0435, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0443\u043d\u043a\u0442\u044b \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0442\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u043c, &#8212; \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438. \u0412\u043e\u0442 \u043d\u0430\u0448 \u043f\u043b\u0430\u043d, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044b \u043f\u0435\u0440\u0432\u044b\u0435 \u0442\u0440\u0438 \u043f\u0443\u043d\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/668458\/\">\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>:<\/p>\n<ol>\n<li>\n<p><s>\u041f\u0443\u043d\u043a\u0442 1. \u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/s><\/p>\n<\/li>\n<li>\n<p><s>\u041f\u0443\u043d\u043a\u0442 2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 LEMP.<\/s><\/p>\n<\/li>\n<li>\n<p><s>\u041f\u0443\u043d\u043a\u0442 3. \u041f\u0440\u0430\u0432\u0430 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/s><\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u043d\u043a\u0442 4. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 LEMP.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u043d\u043a\u0442 5. \u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u043a\u043e\u0434\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438 \u0438 \u0411\u0414.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u043d\u043a\u0442 6. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u043d\u043a\u0442 7. \u0418\u0442\u043e\u0433.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0447\u0435\u0442\u044b\u0440\u0435 \u044d\u0442\u0430\u043f\u0430. \u0418\u0442\u0430\u043a, \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \/var\/ansible \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f:<\/p>\n<p>.<\/p>\n<p>\u251c\u2500\u2500 hosts.txt<\/p>\n<p>\u251c\u2500\u2500 LEMP<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 defaults<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 main.yml<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 files<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 handlers<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 main.yml<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 meta<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 main.yml<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 README.md<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 tasks<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 apache2_install.yml<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 default_settings.yml<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 default_user_settings.yml<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 exim4_install.yml<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 main.yml<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 mysql_install.yml<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 nginx_install.yml<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 templates<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 tests<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 inventory<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 test.yml<\/p>\n<p>\u2502 \u00a0 \u2514\u2500\u2500 vars<\/p>\n<p>\u2502 \u00a0 \u00a0 \u00a0 \u2514\u2500\u2500 main.yml<\/p>\n<p>\u2514\u2500\u2500 playbook.yml<\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 4. \u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/h3>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>php<\/p>\n<\/li>\n<li>\n<p>nginx<\/p>\n<\/li>\n<li>\n<p>mysql<\/p>\n<\/li>\n<li>\n<p>apache2<\/p>\n<\/li>\n<li>\n<p>exim4<\/p>\n<\/li>\n<\/ol>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 php.<\/h4>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c php \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u043e\u0439 \u0444\u0430\u0439\u043b \u0432 <code>\/var\/ansible\/LEMP\/tasks<\/code> \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c php.yml. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.ansible.com\/ansible\/2.5\/modules\/apt_module.html\">apt<\/a>.<\/p>\n<pre><code>cd \/var\/ansible\/LEMP\/tasks touch php.yml<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code>- name: install php \u00a0\u00a0apt: name={{ item }} update_cache=yes state=latest \u00a0\u00a0with_items: \u00a0\u00a0- git \u00a0\u00a0- php \u00a0\u00a0- php-curl \u00a0\u00a0- php-gd \u00a0\u00a0- php-mbstring \u00a0\u00a0- php-xml \u00a0\u00a0- php-xmlrpc \u00a0\u00a0- php-soap \u00a0\u00a0- php-intl \u00a0\u00a0- php-zip<\/code><\/pre>\n<ol>\n<li>\n<p><a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/user_guide\/playbooks_loops.html\">with_items<\/a>: &#8212; \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043d\u0430\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>name={{ item }} &#8212; \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 item \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 php \u043c\u043e\u0434\u0443\u043b\u0435\u0439. apt \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 item.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 yml-\u0444\u0430\u0439\u043b \u0432 main.yml.<\/p>\n<p>\u0412 main.yml \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c.<\/p>\n<pre><code>#####install php \u00a0\u00a0- include_tasks: php.yml<\/code><\/pre>\n<p>\u0414\u043b\u044f php \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c php.ini \u0444\u0430\u0439\u043b.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e php \u0438 \u0444\u0430\u0439\u043b php-ansible.ini \u0432 <code>\/var\/ansible\/LEMP\/files\/<\/code>.<\/p>\n<pre><code>cd\u00a0\/var\/ansible\/LEMP\/files\/ mkdir php touch php\/php.ini<\/code><\/pre>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0444\u0430\u0439\u043b php-ansible.ini, \u043f\u043e\u0441\u043b\u0435 [PHP], \u043b\u044e\u0431\u0443\u044e\u00a0\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0432\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code>[PHP]  <\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432 <code>\/etc\/php\/7.3\/apache2\/<\/code>. \u041e\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 php. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e apache2.<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b php.yml \u0432 \u0437\u0430\u0434\u0430\u043d\u0438\u044f\u0445 <code>(\/var\/ansible\/LEMP\/tasks\/php.yml)<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 apache2.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code>- name: copy config \u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0src: php\/php-ansible.ini \u00a0\u00a0\u00a0\u00a0dest: \/etc\/php\/7.3\/apache2  - name: restart apache2 \u00a0\u00a0service: \u00a0\u00a0\u00a0\u00a0name: apache2 \u00a0\u00a0\u00a0\u00a0state: restarted<\/code><\/pre>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 nginx.<\/h4>\n<ol>\n<li>\n<p>\u0414\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b\u00a0nginx:<\/p>\n<ol>\n<li>\n<p>nginx.conf;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438. domain_name.conf.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c nginx.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>\/var\/ansible\/LEMP\/files<\/code>.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e nginx.<\/p>\n<pre><code>mkdir nginx cd nginx\/<\/code><\/pre>\n<p>\u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 nginx \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c 2 \u0444\u0430\u0439\u043b\u0430: <strong>nginx.conf<\/strong> \u0438 <strong>domain_name.conf<\/strong>.<\/p>\n<pre><code>touch nginx.conf domain_name.conf<\/code><\/pre>\n<ol>\n<li>\n<p>nginx.conf  \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e nginx<\/p>\n<\/li>\n<li>\n<p>domain_name.conf\u00a0\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 sites-available.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 nginx.conf \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/646023\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439\u00a0\u0441\u0442\u0430\u0442\u044c\u0438<\/a>.<\/p>\n<p>\u0412 domain_name.conf \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/646545\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/a>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 <code>.\/tasks\/nginx_install.yml<\/code>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/docs.ansible.com\/ansible\/2.5\/modules\/copy_module.html\">copy<\/a> \u0438 <a href=\"https:\/\/docs.ansible.com\/ansible\/2.5\/modules\/file_module.html\">file<\/a>.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code>\u00a0\u00a0- name: Copy config. \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: nginx\/nginx.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/nginx\/nginx.conf  \u00a0\u00a0- name: Copy domain_name\u00a0 config \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: nginx\/domain_name.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/nginx\/sites-available\/domain_name.conf  \u00a0\u00a0- name: enable site domain_name \u00a0\u00a0\u00a0\u00a0file: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: \/etc\/nginx\/sites-available\/domain_name.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/nginx\/sites-enabled\/domain_name.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: link  \u00a0\u00a0- name: restart nginx \u00a0\u00a0\u00a0\u00a0service: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: nginx \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: restarted<\/code><\/pre>\n<ol>\n<li>\n<p>src &#8212; \u0444\u0430\u0439\u043b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 .\/files;<\/p>\n<\/li>\n<li>\n<p>dest &#8212; \u0430\u0434\u0440\u0435\u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<\/p>\n<pre><code>TASK [LEMP : include_tasks] ************************************************************************************************************************************************************************************* included: \/var\/ansible\/LEMP\/tasks\/nginx_install.yml for ansible2 TASK [LEMP : Install nginx] ************************************************************************************************************************************************************************************* ok: [ansible2] TASK [LEMP : Copy config.] ************************************************************************************************************************************************************************************** changed: [ansible2] TASK [LEMP : Copy domain_name\u00a0 config] ************************************************************************************************************************************************************************** changed: [ansible2] TASK [LEMP : enable site domain_name] *************************************************************************************************************************************************************************** changed: [ansible2] PLAY RECAP ****************************************************************************************************************************************************************************************************** ansible2 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 : ok=4\u00a0 \u00a0 changed=3\u00a0 \u00a0 unreachable=0\u00a0 \u00a0 failed=0<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f nginx \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430.\u00a0<\/p>\n<p>\u0418\u0442\u043e\u0433:<\/p>\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f nginx \u0438 domain_name.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u0432 sites-enabled.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 mysql.<\/h4>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b mysql.cnf, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e mysql \u0432 <code>\/var\/ansible\/LEMP\/files<\/code>.<\/p>\n<pre><code>cd \/var\/ansible\/LEMP\/files mkdir mysql cd mysql\/ touch mysql.cnf<\/code><\/pre>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435 [mysqld] \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0432\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<\/p>\n<pre><code>[mysqld] <\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 ansible mysql <code>\/var\/ansible\/LEMP\/tasks\/mysql_install.yml<\/code><\/p>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c mysql.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code>\u00a0\u00a0- name: Copy config \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: mysql\/mysql.cnf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/mysql\/mysql.conf.d\/mysql.cnf  \u00a0\u00a0- name: restart mysql \u00a0\u00a0\u00a0\u00a0service: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: mysql \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: restarted<\/code><\/pre>\n<p>\u0418\u0442\u043e\u0433:<\/p>\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 mysql.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 mysql \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 apache2.<\/h4>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043a\u0430\u043a \u0438 \u0443 nginx<\/p>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c<\/p>\n<ol>\n<li>\n<p>apache2.conf<\/p>\n<\/li>\n<li>\n<p>domain_name.conf<\/p>\n<\/li>\n<li>\n<p>ports.conf<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0438 \u0432\u044b\u0448\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>\/var\/ansible\/LEMP\/files<\/code>.<\/p>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f apache2 \u0438 domain_name \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439:<\/p>\n<ol>\n<li>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u00a0<a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/646023\/\">apache2.conf<\/a><\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u00a0<a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/646545\/\">domain_name.conf<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 apache2 \u043d\u0430 81 \u043f\u043e\u0440\u0442\u0443. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e\u00a0\u0434\u043b\u044f ports.conf:<\/p>\n<pre><code>Listen 81 &lt;IfModule ssl_module> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Listen 443 &lt;\/IfModule>  &lt;IfModule mod_gnutls.c> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Listen 443 &lt;\/IfModule><\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u043c \u0432 <code>\/var\/ansible\/LEMP\/tasks\/apache2_install.yml<\/code><\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code>\u00a0- name: copy config \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: apache2\/apache2.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/apache2\/apache2.conf  \u00a0\u00a0- name: copy domain_name config \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: apache2\/domain_name.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/apache2\/sites-available\/domain_name.conf  \u00a0\u00a0- name: enable site domain_name \u00a0\u00a0\u00a0\u00a0file: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: \/etc\/apache2\/sites-available\/domain_name.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/apache2\/sites-enabled\/domain_name.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: link  \u00a0\u00a0- name: copy ports \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: apache2\/ports.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/apache2\/ports.conf  \u00a0\u00a0- name: restart apache2 \u00a0\u00a0\u00a0\u00a0service: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: apache2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: restarted<\/code><\/pre>\n<p>\u0418\u0442\u043e\u0433:<\/p>\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 apache2.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 exim4.<\/h4>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e:<\/p>\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 <code>\/etc\/exim4\/update-exim4.conf.conf<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c exim4.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e exim4 \u0438 \u0444\u0430\u0439\u043b update-exim4.conf.conf \u0432 <code>\/var\/ansible\/LEMP\/files<\/code>.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 exim4:<\/p>\n<pre><code># \/etc\/exim4\/update-exim4.conf.conf # # Edit this file and \/etc\/mailname by hand and execute update-exim4.conf # yourself or use 'dpkg-reconfigure exim4-config' # # Please note that this is _not_ a dpkg-conffile and that automatic changes # to this file might happen. The code handling this will honor your local # changes, so this is usually fine, but will break local schemes that mess # around with multiple versions of the file. # # update-exim4.conf uses this file to determine variable values to generate # exim configuration macros for the configuration file. # # Most settings found in here do have corresponding questions in the # Debconf configuration, but not all of them. # # This is a Debian specific file dc_eximconfig_configtype='local' dc_other_hostnames='domain_name' dc_local_interfaces='127.0.0.1 ; ::1' dc_readhost='' dc_relay_domains='' dc_minimaldns='false' dc_relay_nets='' dc_smarthost='' CFILEMODE='644' dc_use_split_config='false' dc_hide_mailname='' dc_mailname_in_oh='true' dc_localdelivery='mail_spool'<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 <code>(\/var\/ansible\/LEMP\/tasks\/exim4_install.yml)<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c &#171;\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430&#187; \u0438 &#171;\u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 exim4&#187;.<\/p>\n<pre><code>\u00a0\u00a0- name: copy config \u00a0\u00a0\u00a0\u00a0copy: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: exim4\/update-exim4.conf.conf \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0dest: \/etc\/exim4\/update-exim4.conf.conf  \u00a0\u00a0- name: restart exim4 \u00a0\u00a0\u00a0\u00a0service: \u00a0\u00a0\u00a0\u00a0 \u00a0name: exim4 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state: restarted<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f exim4 \u0433\u043e\u0442\u043e\u0432\u0430.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 files \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439:<\/p>\n<p>\u251c\u2500\u2500 files<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 apache2<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 apache2.conf<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 domain_name.conf<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 ports.conf<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 exim4<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 update-exim4.conf.conf<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 mysql<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u2514\u2500\u2500 mysql.cnf<\/p>\n<p>\u2502 \u00a0 \u251c\u2500\u2500 nginx<\/p>\n<p>\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 domain_name.conf<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-335168","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/335168","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=335168"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/335168\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=335168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=335168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=335168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}