diff --git a/1/play.yml b/1/play.yml index 1223dc8..341e692 100644 --- a/1/play.yml +++ b/1/play.yml @@ -1,7 +1,10 @@ - - hosts: localhost - become: true - roles: - - nginx - - php - - mysql - - webapps \ No newline at end of file +- hosts: localhost + become: true + vars: + domain: zz777.ru + roles: + - nginx + - php + - mysql + - webapps + \ No newline at end of file diff --git a/1/roles/nginx/files/sites-enabled/cloud.conf b/1/roles/nginx/files/sites-enabled/cloud.conf index f2867a9..0fa5759 100644 --- a/1/roles/nginx/files/sites-enabled/cloud.conf +++ b/1/roles/nginx/files/sites-enabled/cloud.conf @@ -61,7 +61,7 @@ server { fastcgi_param front_controller_active true; fastcgi_send_timeout 1200; fastcgi_read_timeout 1200; - fastcgi_pass unix:/run/php/php-fpm.sock; + fastcgi_pass unix:/run/php/php-cloud.sock; fastcgi_intercept_errors on; fastcgi_request_buffering off; } diff --git a/1/roles/nginx/files/sites-enabled/pma.conf b/1/roles/nginx/files/sites-enabled/pma.conf index fcf6c68..37c05bd 100644 --- a/1/roles/nginx/files/sites-enabled/pma.conf +++ b/1/roles/nginx/files/sites-enabled/pma.conf @@ -22,7 +22,7 @@ server { } location ~ .*.php$ { include /etc/nginx/fastcgi.conf; - fastcgi_pass unix:/run/php/php-fpm.sock; + fastcgi_pass unix:/run/php/php-other.sock; fastcgi_index index.php; } location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { diff --git a/1/roles/nginx/files/sites-enabled/root.conf b/1/roles/nginx/files/sites-enabled/root.conf index 6a1d0fe..3f31bca 100644 --- a/1/roles/nginx/files/sites-enabled/root.conf +++ b/1/roles/nginx/files/sites-enabled/root.conf @@ -33,7 +33,7 @@ server { location ^~ /.well-known/acme-challenge { } location ~ .*.php$ { include /etc/nginx/fastcgi.conf; - fastcgi_pass unix:/run/php/php7.4-fpm.sock; + fastcgi_pass unix:/run/php/php-other.sock; fastcgi_index index.php; } location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { diff --git a/1/roles/nginx/files/sites-enabled/wiki.conf b/1/roles/nginx/files/sites-enabled/wiki.conf index 3ac4749..c0db1cf 100644 --- a/1/roles/nginx/files/sites-enabled/wiki.conf +++ b/1/roles/nginx/files/sites-enabled/wiki.conf @@ -26,7 +26,7 @@ server { } location ~ .*.php$ { include /etc/nginx/fastcgi.conf; - fastcgi_pass unix:/run/php/php-fpm.sock; + fastcgi_pass unix:/run/php/php-wiki.sock; fastcgi_index index.php; } location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { diff --git a/1/roles/nginx/vars/main.yml b/1/roles/nginx/vars/main.yml index 0207bd7..04279f8 100644 --- a/1/roles/nginx/vars/main.yml +++ b/1/roles/nginx/vars/main.yml @@ -1,3 +1,3 @@ --- -domain: zz777.ru +# domain: zz777.ru root: /var/www \ No newline at end of file diff --git a/1/roles/php/files/pool.d/www.conf b/1/roles/php/files/pool.d/www.conf new file mode 100644 index 0000000..6182f62 --- /dev/null +++ b/1/roles/php/files/pool.d/www.conf @@ -0,0 +1,11 @@ +[{{item}}] +user = www-data +group = www-data +listen = /run/php/php-{{item}}.sock +listen.owner = www-data +listen.group = www-data + +pm = static +pm.max_children = 4 +php_admin_value[error_log] = /var/log/fpm-err.log +;php_value[max_execution_time] = 600 diff --git a/1/roles/php/tasks/main.yml b/1/roles/php/tasks/main.yml index 6d0c675..f9b4645 100644 --- a/1/roles/php/tasks/main.yml +++ b/1/roles/php/tasks/main.yml @@ -3,3 +3,12 @@ apt: name: ['php-fpm', 'php-imagick', 'php-memcached', 'php-zip', 'php-mysql', 'php-gd', 'php-mbstring', 'php-xml'] state: present + +- name: Configure php-fpm pools + template: + src: files/pool.d/www.conf + dest: /etc/php/7.4/fpm/pool.d/{{ item }}.conf + loop: + - cloud + - wiki + - other \ No newline at end of file diff --git a/1/roles/php/vars/main.yml b/1/roles/php/vars/main.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/1/roles/php/vars/main.yml @@ -0,0 +1 @@ +--- diff --git a/README.md b/README.md index 8218bf2..4f93b00 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Web: - [x] Тестовая (about) страница на домене xz777.ru - [x] default_server ведет на тестовую страницу -Для mediawiki и nextcloud свои php-fpm pool'ы + - [x] Для mediawiki и nextcloud свои php-fpm pool'ы - [ ] Установить nextcloud - [ ] Установить mediawiki