Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added example uwsgi INI file #3331

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions webserver-configs/uwsgi-grav.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
[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/cache/%n:/dev/urandom:/usr/lib/php/modules:/proc/meminfo
# 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:/run/redis/redis.sock:/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