File tree Expand file tree Collapse file tree 11 files changed +2079
-0
lines changed
Expand file tree Collapse file tree 11 files changed +2079
-0
lines changed Original file line number Diff line number Diff line change 1+ .tags
2+
Original file line number Diff line number Diff line change 1+ php7-fpm Ansible playbook
2+ =========================
3+
4+ This playbook will install php7-fpm in Xenial (16.04)
5+
6+ Requirements
7+ ------------
8+
9+ Required packages (installed automatically) :
10+
11+ - php7-fpm
12+ - php7.0-opcache
13+ - php-apcu
14+ - php7.0-mcrypt
15+ - php7.0-gd
16+ - php7.0-curl
17+ - php-pear
18+ - php7.0-mysql
19+
20+ Role Variables
21+ --------------
22+
23+ - ` php7_memory_limit ` : max memory per PHP process (default: 128M)
24+ - ` php7_post_max_size ` : max post size (default: 40M)
25+ - ` php7_upload_max_filesize ` : max upload size for files (default: 20M)
26+
27+
28+ Tags
29+ ----
30+
31+ - ` php7-fpm ` : applies to the whole role
32+
33+ Dependencies
34+ ------------
35+
36+ - git@github.com : leucos /ansible-nginx.git
37+
38+ Example Playbook
39+ ----------------
40+
41+ This is mainly used as a dependency in your existing playbooks, like:
42+
43+ dependencies:
44+ - { role: ansible-php7-fpm }
45+
46+ but can be used in playbooks also :
47+
48+ - name: web servers
49+ hosts: webservers
50+ roles:
51+ - ansible-php7-fpm
52+
53+ License
54+ -------
55+
56+ MIT
57+
58+ Author Information
59+ ------------------
60+
61+ @leucos
62+
Original file line number Diff line number Diff line change 1+ # -*- yaml -*-
2+
3+ php7_fix_pathinfo : 1
4+ php7_memory_limit : 128M
5+ php7_post_max_size : 40M
6+ php7_upload_max_filesize : 20M
Original file line number Diff line number Diff line change 1+ - name : Restart php7-fpm
2+ service : name=php7-fpm state=restarted
3+ notify :
4+ - Restart nginx
Original file line number Diff line number Diff line change 1+ ---
2+ galaxy_info :
3+ author : Michel Blanc
4+ description : php7-fpm role
5+ company : ACME Corp
6+ license : MIT
7+ min_ansible_version : 1.8
8+
9+ platforms :
10+ - name : Ubuntu
11+ versions :
12+ - all
13+ - name : Debian
14+ versions :
15+ - all
16+ categories :
17+ - development
18+
19+ dependencies :
20+ - role : ansible-nginx
21+
Original file line number Diff line number Diff line change 1+ - include : php7-fpm.yml tags=php7-fpm
Original file line number Diff line number Diff line change 1+ - name : Installs php7-fpm
2+ apt : pkg={{ item }} state=latest
3+ notify :
4+ - Restart nginx
5+ with_items :
6+ - php7-fpm
7+ - php-apcu
8+ - php7-mcrypt
9+ - php7-gd
10+ - php7-curl
11+ - php-pear
12+ - php7-mysql
13+
14+ - name : Adds php.ini
15+ template :
16+ src : " ../templates/php.ini.j2"
17+ dest : /etc/php/7.0/fpm/php.ini
18+ backup : yes
19+ notify :
20+ - Restart php7-fpm
21+ - Restart nginx
22+
23+ - name : Adds nginx buffer tuning
24+ template :
25+ src : " ../templates/fastcgi_buffers.conf.j2"
26+ dest : /etc/nginx/conf.d/fastcgi_buffers.conf
27+ notify :
28+ - Restart php7-fpm
29+ - Restart nginx
30+
31+ - name : Adds pear channels
32+ shell : pear channel-discover {{ item }}
33+ with_items : pear.channels
34+ when : pear is defined
35+
36+ - name : Adds pear packages
37+ shell : pear install {{ item }}
38+ with_items : pear.packages
39+ when : pear is defined
40+
Original file line number Diff line number Diff line change 1+ #
2+ #
3+ server {
4+ listen 80; ## listen for ipv4; this line is default and implied
5+
6+ root {{ nginx_root }};
7+ index index.php index.html index.htm;
8+
9+ # Make site accessible from http://localhost/
10+ server_name _;
11+
12+ location / {
13+ try_files $uri $uri/ /index.php?q=$uri& $args;
14+ # Uncomment to enable naxsi on this location
15+ # include /etc/nginx/naxsi.rules
16+ }
17+
18+ error_page 404 /404.html;
19+
20+ # redirect server error pages to the static page /50x.html
21+ #
22+ error_page 500 502 503 504 /50x.html;
23+ location = /50x.html {
24+ root /usr/share/nginx/html/;
25+ }
26+
27+ # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
28+ #
29+ location ~ \.php$ {
30+ try_files $uri =404;
31+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
32+ fastcgi_pass unix:/var/run/php5-fpm.sock;
33+ fastcgi_index index.php;
34+ include fastcgi_params;
35+ }
36+
37+ # deny access to .htaccess files, if Apache's document root
38+ # concurs with nginx's one
39+ #
40+ location ~ /\.ht {
41+ deny all;
42+ }
43+ }
Original file line number Diff line number Diff line change 1+ fastcgi_buffers 16 32k;
2+ fastcgi_buffer_size 32k;
You can’t perform that action at this time.
0 commit comments