Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12239824
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/pillar/paas/alkane/windriver/drive.sls b/pillar/paas/alkane/windriver/drive.sls
new file mode 100644
index 0000000..b36341c
--- /dev/null
+++ b/pillar/paas/alkane/windriver/drive.sls
@@ -0,0 +1,41 @@
+# -------------------------------------------------------------
+# Salt — PaaS Alkane :: PHP and static sites [development]
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Site: https://drive.nasqueron.org/
+# -------------------------------------------------------------
+
+web_aliases:
+ services:
+ - &db-B 172.27.27.9
+
+# -------------------------------------------------------------
+# PHP sites
+#
+# Username must be unique and use max 31 characters.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+web_php_sites:
+ drive.nasqueron.org:
+ domain: nasqueron.org
+ subdomain: drive
+ user: web-org-nasqueron-drive
+ php-fpm: prod
+ php_flags:
+ opcache.save_comments: on
+ opcache.validate_timestamp: off
+ php_values:
+ opcache.jit: 1255
+ opcache.jit_buffer_size: 128M
+
+ env:
+ DB_HOST: *db-B
+ DB_NAME: nextcloud_windriver
+
+ # Per NextCloud documentation
+ HOSTNAME: $HOSTNAME
+ PATH: /usr/local/bin:/usr/bin:/bin
+ TMP: /tmp
+ TMPDIR: /tmp
+ TEMP: /tmp
diff --git a/roles/webserver-alkane/php/files/php-fpm-pool.conf b/roles/webserver-alkane/php/files/php-fpm-pool.conf
index 3a8a0ed..30a17ef 100644
--- a/roles/webserver-alkane/php/files/php-fpm-pool.conf
+++ b/roles/webserver-alkane/php/files/php-fpm-pool.conf
@@ -1,49 +1,57 @@
; -------------------------------------------------------------
; php-fpm pool configuration
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; Project: Nasqueron
; License: Trivial work, not eligible to copyright
; Source file: roles/webserver-alkane/php/files/php-fpm-pool.conf
; -------------------------------------------------------------
;
; <auto-generated>
; This file is managed by our rOPS SaltStack repository.
;
; Changes to this file may cause incorrect behavior
; and will be lost if the state is redeployed.
; </auto-generated>
[{{ user }}]
listen = /var/run/web/{{ fqdn }}/php-fpm.sock
listen.owner = {{ user }}
listen.group = web
listen.mode = 0660
user = {{ user }}
group = web
pm = ondemand
pm.max_children = 8
pm.process_idle_timeout = 10s
pm.max_requests = 50
slowlog = /var/log/www/{{ domain }}/{{ subdomain }}-php-slow.log
request_slowlog_timeout = {{ slow_delay }}
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 php_flags.items() -%}
+php_flag[{{ key }}] = {{ value }}
+{% endfor -%}
+
+{% for key, value in php_values.items() -%}
+php_value[{{ key }}] = {{ value }}
+{% endfor -%}
+
{% if 'wordpress' in capabilities -%}
; Allow Wordpress to process large images
php_value[memory_limit] = 1024M
{%- endif %}
; Don't flood /tmp (T417)
php_value[session.save_path] = /var/tmp/php/sessions/{{ fqdn }}
{%- for key, value in env.items() %}
env["{{ key }}"] = {{ value }}
{%- endfor -%}
diff --git a/roles/webserver-alkane/php/php-fpm.sls b/roles/webserver-alkane/php/php-fpm.sls
index 901447a..7605734 100644
--- a/roles/webserver-alkane/php/php-fpm.sls
+++ b/roles/webserver-alkane/php/php-fpm.sls
@@ -1,85 +1,87 @@
# -------------------------------------------------------------
# Salt — Provision PHP websites — php-fpm pools
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
{% from "map.jinja" import dirs with context %}
# -------------------------------------------------------------
# Configuration : instances
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% for instance, config in pillar['php_fpm_instances'].items() %}
php-fpm_config_{{ instance }}:
file.managed:
- name: {{ dirs.etc }}/php-fpm.d/{{ instance }}.conf
- source: salt://roles/webserver-alkane/php/files/php-fpm.conf
- template: jinja
- context:
instance: {{ instance }}
{{ dirs.etc }}/php-fpm.d/{{ instance }}-pools:
file.directory
{% endfor %}
# -------------------------------------------------------------
# Configuration : pools
#
# Sockets are created in /var/run/web/<site user>/php-fpm.sock
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/var/run/web:
file.directory:
- group: web
- dir_mode: 711
{% for fqdn, site in pillar['web_php_sites'].items() %}
php-fpm_pool_{{ site['user'] }}:
file.managed:
- name: {{ dirs.etc }}/php-fpm.d/{{ site['php-fpm'] }}-pools/{{ site['user'] }}.conf
- source: salt://roles/webserver-alkane/php/files/php-fpm-pool.conf
- template: jinja
- context:
fqdn: {{ fqdn }}
domain: {{ site['domain'] }}
subdomain: {{ site['subdomain'] }}
user: {{ site['user' ] }}
display_errors: {{ site['display_errors'] | default('off') }}
slow_delay: {{ site['slow_delay'] | default('5s') }}
+ php_flags: {{ site['php_flags'] | default({}) }}
+ php_values: {{ site['php_values'] | default({}) }}
env : {{ site['env'] | default({}) }}
capabilities: {{ site['capabilities'] | default([]) }}
/var/log/www/{{ site['domain' ] }}/{{ site['subdomain' ] }}-php.log:
file.managed:
- replace: False
- user: {{ site['user'] }}
- group: web
- chmod: 600
{% endfor %}
# -------------------------------------------------------------
# Sessions directories
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/var/tmp/php:
file.directory:
- mode: 1770
- group: web
/var/tmp/php/sessions:
file.directory:
- mode: 1770
- group: web
{% for fqdn, site in pillar['web_php_sites'].items() %}
/var/tmp/php/sessions/{{ fqdn }}:
file.directory:
- mode: 700
- user: {{ site['user'] }}
{% endfor %}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Oct 12, 00:31 (19 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3064342
Default Alt Text
(6 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment