add support for php
This commit is contained in:
parent
c3c9fddc12
commit
8e524d2a8e
|
@ -1 +1,3 @@
|
|||
---
|
||||
# webserver_dehydrated_email: "" # required
|
||||
webserver_php_enabled: false
|
||||
|
|
|
@ -6,3 +6,8 @@
|
|||
|
||||
- name: dehydrated
|
||||
command: /usr/bin/dehydrated -c
|
||||
|
||||
- name: restart php-fpm
|
||||
systemd:
|
||||
name: php-fpm
|
||||
state: restarted
|
||||
|
|
|
@ -67,6 +67,10 @@
|
|||
state: started
|
||||
enabled: yes
|
||||
|
||||
- name: php
|
||||
import_tasks: php.yml
|
||||
when: webserver_php_enabled
|
||||
|
||||
- name: enabled nginx
|
||||
systemd:
|
||||
name: nginx
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
- name: Install php
|
||||
package:
|
||||
state: latest
|
||||
name:
|
||||
- php-fpm
|
||||
- php-gd
|
||||
- php-imap
|
||||
|
||||
- name: enable extension
|
||||
notify: restart php-fpm
|
||||
lineinfile:
|
||||
path: /etc/php/php.ini
|
||||
regexp: ';extension={{ item }}'
|
||||
line: "extension={{ item }}"
|
||||
with_items:
|
||||
- curl
|
||||
- gd
|
||||
- imap
|
||||
- mysqli
|
||||
- pdo_mysql
|
||||
- zip
|
||||
|
||||
- name: enabled and started php-fpm
|
||||
systemd:
|
||||
name: php-fpm
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
- name: templates php nginx
|
||||
notify: reload nginx
|
||||
template:
|
||||
src: "php.nginx"
|
||||
dest: "/etc/nginx/snippets/php.conf"
|
|
@ -0,0 +1,14 @@
|
|||
index index.html index.htm index.php;
|
||||
|
||||
location ~ \.php(?:$|/) {
|
||||
fastcgi_split_path_info ^(.+.php)(/.+)$;
|
||||
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
|
||||
include fastcgi.conf;
|
||||
|
||||
fastcgi_param PHP_ADMIN_VALUE open_basedir=$document_root:/tmp:/usr/share/pear:/dev/urandom;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param HTTPS on;
|
||||
}
|
Loading…
Reference in New Issue