Skip to content
Snippets Groups Projects
Commit 53745a9b authored by jurgenhaas's avatar jurgenhaas
Browse files

Optionally run PHP FPM over a socket

parent 2c04d3bc
No related branches found
No related tags found
No related merge requests found
php_version: '7.0'
php_version_main: '7'
php_fpm_socket: false
php_install_redis: true
php_hold_version: false
php_repositories: []
......
......@@ -127,6 +127,25 @@
group=root
mode='644'
- block:
- name: "PHP | Apache FPM Socket Configuration"
template:
src='etc-apache2-conf-available-php-fpm'
dest='/etc/apache2/{{ apache_conf_dir }}/php{{ php_version_main }}-fpm.conf'
owner='root'
group='root'
mode='644'
notify:
- "Apache | Restart Apache"
- name: "PHP | Enable Apache PHP FPM Configuration"
command: a2enconf php{{ php_version_main }}-fpm creates=/etc/apache2/conf-enabled/php{{ php_version_main }}-fpm{{ apache_conf_ext }}
notify:
- "Apache | Restart Apache"
when: php_fpm_socket
- name: "PHP | FPM Default Pool Configuration"
template:
src=php_pool.conf
......
<IfModule mod_fastcgi.c>
AddHandler php{{ php_version_main }}-fcgi .php
Action php{{ php_version_main }}-fcgi /php{{ php_version_main }}-fcgi
Alias /php{{ php_version_main }}-fcgi /usr/lib/cgi-bin/php{{ php_version_main }}-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php{{ php_version_main }}-fcgi -socket /var/run/php{{ php_version_main }}-fpm.sock -pass-header Authorization
<Directory /usr/lib/cgi-bin>
Include /etc/apache2/{{ apache_conf_dir }}/global-deny.conf
</Directory>
</IfModule>
......@@ -3,7 +3,11 @@ user = www-data
group = www-data
;chroot = /var/www{{apache_server_default_root|default('')}}
chdir = /
{% if php_fpm_socket %}
listen = /var/run/php{{ php_version_main }}-fpm.sock
{% else %}
listen = 127.0.0.1:9000
{% endif %}
; Process manager
pm = dynamic
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment