Page MenuHomeDevCentral

D1252.diff
No OneTemporary

D1252.diff

diff --git a/pillar/webserver/sites.sls b/pillar/webserver/sites.sls
--- a/pillar/webserver/sites.sls
+++ b/pillar/webserver/sites.sls
@@ -52,6 +52,8 @@
web_php_sites:
# Nasqueron members
www.dereckson.be:
+ domain: dereckson.be
+ subdomain: www
user: web-be-dereckson-www
source: wwwroot/dereckson.be/www
target: /var/wwwroot/dereckson.be/www
@@ -59,6 +61,8 @@
# Directly managed by Nasqueron
api.nasqueron.org:
+ domain: nasqueron.org
+ subdomain: api
user: web-org-nasqueron-api-serverslog
php-fpm: prod
env:
diff --git a/roles/webserver-legacy/php-sites/files/php-fpm-pool.conf b/roles/webserver-legacy/php-sites/files/php-fpm-pool.conf
--- a/roles/webserver-legacy/php-sites/files/php-fpm-pool.conf
+++ b/roles/webserver-legacy/php-sites/files/php-fpm-pool.conf
@@ -14,7 +14,7 @@
; </auto-generated>
[{{ user }}]
-listen = /var/run/web/{{ domain }}/php-fpm.sock
+listen = /var/run/web/{{ fqdn }}/php-fpm.sock
listen.owner = {{ user }}
listen.group = web
listen.mode = 0666
@@ -27,6 +27,12 @@
pm.process_idle_timeout = 10s
pm.max_requests = 200
+catch_workers_output = yes
+php_admin_value[error_log] = /var/log/www/{{ domain }}/{{ subdomain }}-php.log
+php_flag[display_errors] = {{ display_errors }}
+php_flag[display_startup_errors] = {{ display_errors }}
+php_admin_flag[log_errors] = on
+
{%- for key, value in env.iteritems() %}
env["{{ key }}"] = {{ value }}
{% endfor -%}
diff --git a/roles/webserver-legacy/php-sites/php-fpm.sls b/roles/webserver-legacy/php-sites/php-fpm.sls
--- a/roles/webserver-legacy/php-sites/php-fpm.sls
+++ b/roles/webserver-legacy/php-sites/php-fpm.sls
@@ -30,7 +30,7 @@
# Configuration : pools
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-{% for domain, site in pillar['web_php_sites'].iteritems() %}
+{% for fqdn, site in pillar['web_php_sites'].iteritems() %}
php-fpm_pool_{{ site['user'] }}:
file.managed:
@@ -38,10 +38,19 @@
- source: salt://roles/webserver-legacy/php-sites/files/php-fpm-pool.conf
- template: jinja
- context:
- domain: {{ domain }}
+ fqdn: {{ fqdn }}
+ domain: {{ site['domain'] }}
+ subdomain: {{ site['subdomain'] }}
user: {{ site['user' ]}}
+ display_errors: {{ site['display_errors']|default('off') }}
env : {{ site['env']|default({}) }}
+/var/log/www/{{ site['domain' ]}}/{{ site['subdomain' ]}}-php.log:
+ file.managed:
+ - user: {{ site['user'] }}
+ - group: web
+ - chmod: 600
+
{% endfor %}
# -------------------------------------------------------------

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 6, 15:19 (19 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2232039
Default Alt Text
D1252.diff (2 KB)

Event Timeline