summarylogtreecommitdiffstats
path: root/grav.uwsgi.ini
blob: 500a48aa2097cdcd3fe320232c4c350cffb230c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
[uwsgi]
; load the required plugins
plugins = php
; force the sapi name to 'apache', this will enable the opcode cache  
php-sapi-name = apache

; set master process name and socket
; '%n' refers to the name of this configuration file without extension
procname-master = uwsgi %n
master = true

; drop privileges
uid    = grav
gid    = grav
umask  = 022

socket = /run/uwsgi/%n.sock
chown-socket = %(uid):http
chmod-socket = 660
vacuum = true

# uncomment for a stats socket, that can be used with uwsgitop
# stats = /run/uwsgi/%n-stats.sock

; run with at least 1 process but increase up to 4 when needed
processes = 4
cheaper = 1
# idle = 600
# die-on-idle = true

; reload whenever this config file changes
; %p is the full path of the current config file
touch-reload = %p

; disable uWSGI request logging
disable-logging = true

; enforce a DOCUMENT_ROOT
php-docroot = /usr/share/webapps/%n
chdir = /usr/share/webapps/%n

; limit allowed extensions
php-allowed-ext = .php
; and search for index.php if required
php-index = index.php

; set php configuration for this instance of php, no need to edit global php.ini
php-set = date.timezone=Europe/Berlin
php-set = open_basedir=/usr/share/webapps/%n:/var/lib/%n:/var/cache/%n:/var/tmp/%n:/etc/webapps/%n:/var/log/%n:/dev/urandom:/usr/lib/php/modules:/proc/meminfo
; avoid security risk of leaving sessions in world-readable /tmp
;php-set = session.save_path=/tmp
php-set = session.save_path=/var/cache/%n/sessions
php-set = expose_php=false

# php-set = memory_limit=512M
php-set = output_buffering=off

; load all extensions only in this instance of php, no need to edit global php.ini
;; required core modules
php-set = extension=gd
;php-set = extension=zip     # enabled by default in global php.ini
php-set = extension=yaml

; opcache
php-set = zend_extension=opcache
php-set = opcache.enable=1
;php-set = opcache.enable_cli=1
php-set = opcache.interned_strings_buffer=8
php-set = opcache.max_accelerated_files=10000
php-set = opcache.memory_consumption=128
php-set = opcache.save_comments=1
php-set = opcache.revalidate_freq=1

; user cache
; provided by php-acpu, to be enabled **either** here **or** in /etc/php/conf.d/apcu.ini
php-set = extension=apcu.so
; per https://github.com/krakjoe/apcu/blob/simplify/INSTALL
php-set = apc.ttl=7200
php-set = apc.enable_cli=1