Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3769302
D1252.id3383.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D1252.id3383.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 14:05 (4 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259574
Default Alt Text
D1252.id3383.diff (2 KB)
Attached To
Mode
D1252: Improve PHP logging on dev server
Attached
Detach File
Event Timeline
Log In to Comment