replaced srcs with submodule wordpress_docker
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
|||||||
[submodule "private"]
|
[submodule "private"]
|
||||||
path = private
|
path = private
|
||||||
url = git@bitbucket.org:hugogogo/2023_website_jipf_private.git
|
url = git@bitbucket.org:hugogogo/2023_website_jipf_private.git
|
||||||
|
[submodule "wordpress_docker"]
|
||||||
|
path = wordpress_docker
|
||||||
|
url = git@bitbucket.org:hugogogo/program_wordpress_docker.git
|
||||||
|
|||||||
157
Makefile
157
Makefile
@@ -1,161 +1,24 @@
|
|||||||
|
|
||||||
GRAY = "\e[0;30m"
|
|
||||||
RED = "\e[0;31m"
|
|
||||||
GREEN = "\e[0;32m"
|
|
||||||
YELLOW = "\e[0;33m"
|
|
||||||
BLUE = "\e[0;34m"
|
|
||||||
PURPLE = "\e[0;35m"
|
|
||||||
CYAN = "\e[0;36m"
|
|
||||||
WHITE = "\e[0;37m"
|
|
||||||
|
|
||||||
B_GRAY = "\e[1;30m"
|
|
||||||
B_RED = "\e[1;31m"
|
|
||||||
B_GREEN = "\e[1;32m"
|
|
||||||
B_YELLOW = "\e[1;33m"
|
|
||||||
B_BLUE = "\e[1;34m"
|
|
||||||
B_PURPLE = "\e[1;35m"
|
|
||||||
B_CYAN = "\e[1;36m"
|
|
||||||
B_WHITE = "\e[1;37m"
|
|
||||||
|
|
||||||
RESET = "\e[0m"
|
|
||||||
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||||
|
# . name = value \ . += append to a variable #
|
||||||
|
# VARIABLES . value . != set result of command #
|
||||||
|
# . name is case sensitive . ?= set if not already set #
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||||
|
|
||||||
COMPOSE = ./srcs/docker-compose.yml
|
WP_DOCKER = ./wordpress_docker
|
||||||
|
|
||||||
# in makefile you can use an env variable directly as a make variable :
|
|
||||||
# -> https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_6.html#SEC68
|
|
||||||
# so if you want to get the home directory you can use $(HOME)
|
|
||||||
# however, this will not give the same result if you run make in sudo, ex :
|
|
||||||
# make : /home/asususus
|
|
||||||
# sudo make : /root
|
|
||||||
# but you can use this command `eval echo "~$SUDO_USER"` to get
|
|
||||||
# the home directory of the user using sudo, it works in non-sudo also :
|
|
||||||
# - echo "$SUDO_USER" :
|
|
||||||
# - in normal mode it output : ""
|
|
||||||
# - in sudo mode it output the user : "username"
|
|
||||||
# - same as $USER in normal mode
|
|
||||||
# - echo "~$SUDO_USER" :
|
|
||||||
# - in linux "~USER" is the home directory of a user
|
|
||||||
# - but echo "something" will treat ~ as a string litteral
|
|
||||||
# - so the output in mormal mode will be : "~"
|
|
||||||
# - and in sudo mode it will be : "~username"
|
|
||||||
# - eval echo "~$SUDO_USER" :
|
|
||||||
# - eval will evaluate the expression and perform expansion one more time
|
|
||||||
# - so it will evaluate the output of `echo "~$SUDO_USER"`
|
|
||||||
# - in normal mode :
|
|
||||||
# - it will evaluate : "~"
|
|
||||||
# - and ouptput : "/home/username"
|
|
||||||
# - in sudo mode :
|
|
||||||
# - it will evaluate : "~username"
|
|
||||||
# - and output : "/home/username"
|
|
||||||
# - because "~username" expand in the home (~) directory of given user
|
|
||||||
# https://stackoverflow.com/questions/77088135/makefile-subst-doesnt-use-make-variable-as-expected
|
|
||||||
USER_HOME := $(shell eval echo "~$$SUDO_USER")
|
|
||||||
# extract env variables in .env file
|
|
||||||
# then expend the home path
|
|
||||||
# then expend the pwd path
|
|
||||||
# and finally remove the leading "EXPEND_" word
|
|
||||||
EXPENDED_ENV_VAR := $(shell grep "^#EXPEND_" ./srcs/.env)
|
|
||||||
EXPENDED_ENV_VAR := $(subst $$HOME_PATH,$(USER_HOME),$(EXPENDED_ENV_VAR))
|
|
||||||
EXPENDED_ENV_VAR := $(subst $$PWD_PATH,$(shell pwd),$(EXPENDED_ENV_VAR))
|
|
||||||
EXPENDED_ENV_VAR := $(EXPENDED_ENV_VAR:#EXPEND_%=%)
|
|
||||||
|
|
||||||
# this creates a list of the path from the list of the variables :
|
|
||||||
# VAR_1=/path/to_1 VAR_2=/path/to_2
|
|
||||||
# becomes :
|
|
||||||
# /path/to_1 /path/to_2
|
|
||||||
# first, foreach execute an action on each space separated parts : the variables
|
|
||||||
# - VAR_1=/path/to_1
|
|
||||||
# - VAR_2=/path/to_2
|
|
||||||
# then on each of them, it substitute the "=" with a space " " :
|
|
||||||
# - VAR_1 /path/to_1
|
|
||||||
# - VAR_2 /path/to_2
|
|
||||||
# and it only keeps the second word :
|
|
||||||
# - /path/to_1
|
|
||||||
# - /path/to_2
|
|
||||||
VOLUMES_D = $(foreach val,$(EXPENDED_ENV_VAR),$(word 2, $(subst =, ,$(val))))
|
|
||||||
|
|
||||||
# url for wordpress, use in makefile to change local
|
|
||||||
WP_URL = $(shell grep "WP_URL" ./srcs/.env | cut -d "=" -f 2)
|
|
||||||
|
|
||||||
# list of running containers, see : https://stackoverflow.com/questions/10024279/how-to-use-shell-commands-in-makefile
|
|
||||||
RUNNING = $(shell docker ps -q)
|
|
||||||
# list of volumes
|
|
||||||
VOLUMES = $(shell docker volume ls -q)
|
|
||||||
|
|
||||||
# ln -s ${WP_VOLUME_PLUGINS}/$dir ${WP_VOLUME_DIR}/wp-content/plugins/$dir
|
|
||||||
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||||
|
# . target: prerequisites . $@ : target #
|
||||||
|
# RULES . recipe . $< : 1st prerequisite #
|
||||||
|
# . recipe . $^ : all prerequisites #
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||||
|
|
||||||
all: require build up
|
|
||||||
|
|
||||||
require:
|
all:
|
||||||
# remove all the lines starting with "HOST_VOLUME_" in .env
|
$(MAKE) $@ -C $(WP_DOCKER)
|
||||||
@echo $(B_PURPLE)"removes all lines starting with 'HOST_VOLUMES' in .env"$(RESET)
|
|
||||||
@sed -i "/^HOST_VOLUME_/d" ./srcs/.env
|
|
||||||
# add new expended lines starting with "HOST_VOLUME_" after the line "# EXPENDED LINES :" in .env
|
|
||||||
@echo $(B_PURPLE)"add new expended lines starting with 'HOST_VOLUME_' in .env"$(RESET)
|
|
||||||
@$(foreach val,$(EXPENDED_ENV_VAR),sed -i "/^# EXPENDED LINES/a\$(val)" ./srcs/.env;)
|
|
||||||
# create the volumes directories
|
|
||||||
@echo $(B_PURPLE)"create the volumes directories"$(RESET)
|
|
||||||
@mkdir -p $(VOLUMES_D)
|
|
||||||
# create the ssl folder to avoid pbm at nginx docker creation
|
|
||||||
@echo $(B_PURPLE)"create the ssl folder"$(RESET)
|
|
||||||
@mkdir -p ./srcs/requirements/nginx/conf/ssl
|
|
||||||
# verify if the wordpress url is added to the local path
|
|
||||||
@echo $(B_PURPLE)"verify if the wordpress url is added to the local path"$(RESET)
|
|
||||||
@- if ! grep "127.0.0.1 $(WP_URL)" /etc/hosts 2> /dev/null; then \
|
|
||||||
@echo $(B_PURPLE)"nop ! adding it"$(RESET) \
|
|
||||||
bash -c 'echo -e "\n# adding for lejourduprof (you can delete it)\n127.0.0.1 $(WP_URL)" >> /etc/hosts'; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
build:
|
|
||||||
docker compose -f $(COMPOSE) build
|
|
||||||
|
|
||||||
up:
|
.PHONY : all
|
||||||
docker compose -f $(COMPOSE) up -d
|
|
||||||
@echo $(B_PURPLE)"you can now connect at "$(B_YELLOW)"https://$(WP_URL)"$(B_PURPLE)" or 127.0.0.1"$(RESET)
|
|
||||||
|
|
||||||
down:
|
|
||||||
docker compose -f $(COMPOSE) down
|
|
||||||
|
|
||||||
# list images, containers, volumes
|
|
||||||
list:
|
|
||||||
@echo $(B_YELLOW)"\nimages:"$(RESET)
|
|
||||||
@docker images -a
|
|
||||||
@echo $(B_YELLOW)"\nvolumes:"$(RESET)
|
|
||||||
@docker volume ls
|
|
||||||
@echo $(B_YELLOW)"\nvolumes content:"$(RESET)
|
|
||||||
- @ls $(VOLUMES_D)
|
|
||||||
@echo $(B_YELLOW)"\nnetworks:"$(RESET)
|
|
||||||
@docker network ls
|
|
||||||
@echo $(B_YELLOW)"\ncontainers:"$(RESET)
|
|
||||||
@docker ps -a
|
|
||||||
@echo ""
|
|
||||||
|
|
||||||
# remove project images and containers not used
|
|
||||||
clean:
|
|
||||||
- docker stop $(RUNNING)
|
|
||||||
docker network prune -f
|
|
||||||
docker system prune -f
|
|
||||||
|
|
||||||
# remove everything except local volumes data
|
|
||||||
fclean-images: clean
|
|
||||||
- docker stop $(RUNNING)
|
|
||||||
docker system prune -af
|
|
||||||
fclean-volumes: clean
|
|
||||||
- docker volume rm $(VOLUMES)
|
|
||||||
fclean: fclean-images fclean-volumes
|
|
||||||
|
|
||||||
re: fclean all
|
|
||||||
|
|
||||||
# !! remove everything everything
|
|
||||||
erase_v:
|
|
||||||
- rm -rf $(VOLUMES_D)
|
|
||||||
new: erase_v re
|
|
||||||
|
|
||||||
.PHONY : all $(VOLUMES_D) require build up list clean fclean re erase_v new
|
|
||||||
|
|
||||||
|
|||||||
49
srcs/.env
49
srcs/.env
@@ -1,49 +0,0 @@
|
|||||||
|
|
||||||
# NGINX SETUP
|
|
||||||
|
|
||||||
NG_VOLUME_CERTS=/etc/ssl
|
|
||||||
|
|
||||||
# MARIADB SETUP
|
|
||||||
|
|
||||||
DB_HOST=mariadb
|
|
||||||
DB_NAME=db_wp_inception
|
|
||||||
DB_USER=user_wp_inception
|
|
||||||
DB_PSWD="too bad you have read this now i have to erase your memory"
|
|
||||||
|
|
||||||
# WORDPRESS SETUP
|
|
||||||
|
|
||||||
WP_URL=local_lejourduprof.com
|
|
||||||
WP_VOLUME_DIR=/var/www/html
|
|
||||||
WP_VOLUME_PLUGINS=/home/www-data
|
|
||||||
WP_TITLE=title
|
|
||||||
|
|
||||||
WP_ADMIN=hulamy
|
|
||||||
WP_ADMIN_PSWD="you shall not password !"
|
|
||||||
WP_ADMIN_EMAIL=hulamy@42.fr
|
|
||||||
|
|
||||||
WP_USER=moehu36
|
|
||||||
WP_USER_PSWD="it's a secret for nobody"
|
|
||||||
WP_USER_EMAIL=moehu36@42.fr
|
|
||||||
|
|
||||||
# MAP
|
|
||||||
|
|
||||||
MAX_UPLOAD_SIZE=512
|
|
||||||
EXECUTION_TIME=300
|
|
||||||
|
|
||||||
# env file does not have expension capacity, so we simulate it with makefile :
|
|
||||||
# 1. the lines starting with "#EXPEND_" will be retrieved by the makefile
|
|
||||||
# 2. then it will expend the $HOME_PATH and $PWD_PATH
|
|
||||||
# 3. then it will remove the leading "#EXPEND_" word
|
|
||||||
# 4. then it will erase all the line starting with "HOST_VOLUME_" if they exist
|
|
||||||
# 5. and finally it will add the expended lines after the line "EXPENDED LINES :"
|
|
||||||
# LINES TO EXPEND :
|
|
||||||
#EXPEND_HOST_VOLUME_WP=$HOME_PATH/data/lejourduprof/wp_volume
|
|
||||||
#EXPEND_HOST_VOLUME_DB=$HOME_PATH/data/lejourduprof/db_volume
|
|
||||||
#EXPEND_HOST_VOLUME_PLUGINS=$PWD_PATH/srcs/plugins
|
|
||||||
#EXPEND_HOST_VOLUME_CERTS=$PWD_PATH/srcs/requirements/nginx/conf/ssl
|
|
||||||
# EXPENDED LINES :
|
|
||||||
HOST_VOLUME_CERTS=/home/asususus/nextcloud_backup/backup_planethoster_server/nextclouddata/hugogogo/files/informatique/jipf_2023/srcs/requirements/nginx/conf/ssl
|
|
||||||
HOST_VOLUME_PLUGINS=/home/asususus/nextcloud_backup/backup_planethoster_server/nextclouddata/hugogogo/files/informatique/jipf_2023/srcs/plugins
|
|
||||||
HOST_VOLUME_DB=/home/asususus/data/lejourduprof/db_volume
|
|
||||||
HOST_VOLUME_WP=/home/asususus/data/lejourduprof/wp_volume
|
|
||||||
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
# doc : https://docs.docker.com/compose/compose-file/compose-versioning/
|
|
||||||
# version : https://docs.docker.com/compose/compose-file/compose-versioning/
|
|
||||||
# version to download : https://github.com/docker/compose/releases/
|
|
||||||
# had to remove the apt version because it was not up to date (sudo apt remove docker-compose)
|
|
||||||
# then install as recommended : curl -SL https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
|
|
||||||
# or (neat) : https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
|
|
||||||
|
|
||||||
version: "3.8"
|
|
||||||
|
|
||||||
services:
|
|
||||||
# ---------------------------------
|
|
||||||
# test:
|
|
||||||
# build:
|
|
||||||
# context: ./requirements/test
|
|
||||||
# dockerfile: Dockerfile
|
|
||||||
# image: test
|
|
||||||
# container_name: test_container
|
|
||||||
# ---------------------------------
|
|
||||||
nginx:
|
|
||||||
restart: on-failure
|
|
||||||
networks:
|
|
||||||
- inception
|
|
||||||
ports:
|
|
||||||
- "443:443"
|
|
||||||
volumes:
|
|
||||||
- wp_volume:${WP_VOLUME_DIR}
|
|
||||||
- wp_plugins:${WP_VOLUME_PLUGINS}
|
|
||||||
- ng_certs:${NG_VOLUME_CERTS}
|
|
||||||
build:
|
|
||||||
context: ./requirements/nginx
|
|
||||||
args:
|
|
||||||
- WP_URL=${WP_URL}
|
|
||||||
- MAX_UPLOAD_SIZE=${MAX_UPLOAD_SIZE}
|
|
||||||
- WP_VOLUME_DIR=${WP_VOLUME_DIR}
|
|
||||||
- WP_VOLUME_PLUGINS=${WP_VOLUME_PLUGINS}
|
|
||||||
- NG_VOLUME_CERTS=${NG_VOLUME_CERTS}
|
|
||||||
image: nginx
|
|
||||||
container_name: nginx_container
|
|
||||||
depends_on:
|
|
||||||
wordpress:
|
|
||||||
condition: service_started
|
|
||||||
# ---------------------------------
|
|
||||||
mariadb:
|
|
||||||
restart: on-failure
|
|
||||||
env_file: .env
|
|
||||||
networks:
|
|
||||||
- inception
|
|
||||||
volumes:
|
|
||||||
- db_volume:/var/lib/mysql
|
|
||||||
build:
|
|
||||||
context: ./requirements/mariadb
|
|
||||||
args:
|
|
||||||
- DB_HOST=${DB_HOST}
|
|
||||||
- DB_NAME=${DB_NAME}
|
|
||||||
- DB_USER=${DB_USER}
|
|
||||||
- DB_PSWD=${DB_PSWD}
|
|
||||||
healthcheck:
|
|
||||||
test: mariadb -h ${DB_HOST} -u ${DB_USER} -p"${DB_PSWD}" -e exit 2> /dev/null
|
|
||||||
interval: 1s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 10
|
|
||||||
image: mariadb
|
|
||||||
container_name: mariadb_container
|
|
||||||
# ---------------------------------
|
|
||||||
wordpress:
|
|
||||||
restart: on-failure
|
|
||||||
env_file: ./.env
|
|
||||||
networks:
|
|
||||||
- inception
|
|
||||||
volumes:
|
|
||||||
- wp_volume:${WP_VOLUME_DIR}
|
|
||||||
- wp_plugins:${WP_VOLUME_PLUGINS}
|
|
||||||
build:
|
|
||||||
context: ./requirements/wordpress
|
|
||||||
args:
|
|
||||||
- WP_VOLUME_DIR=${WP_VOLUME_DIR}
|
|
||||||
- WP_VOLUME_PLUGINS=${WP_VOLUME_PLUGINS}
|
|
||||||
- MAX_UPLOAD_SIZE=${MAX_UPLOAD_SIZE}
|
|
||||||
- EXECUTION_TIME=${EXECUTION_TIME}
|
|
||||||
image: wordpress
|
|
||||||
container_name: wordpress_container
|
|
||||||
depends_on:
|
|
||||||
mariadb:
|
|
||||||
condition: service_healthy
|
|
||||||
|
|
||||||
# specify path to named volumes : https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference
|
|
||||||
volumes:
|
|
||||||
db_volume:
|
|
||||||
driver: local
|
|
||||||
driver_opts:
|
|
||||||
type: none
|
|
||||||
o: "bind"
|
|
||||||
device: ${HOST_VOLUME_DB}
|
|
||||||
wp_volume:
|
|
||||||
driver: local
|
|
||||||
driver_opts:
|
|
||||||
type: none
|
|
||||||
o: "bind"
|
|
||||||
device: ${HOST_VOLUME_WP}
|
|
||||||
wp_plugins:
|
|
||||||
driver: local
|
|
||||||
driver_opts:
|
|
||||||
type: none
|
|
||||||
o: "bind"
|
|
||||||
device: ${HOST_VOLUME_PLUGINS}
|
|
||||||
ng_certs:
|
|
||||||
driver: local
|
|
||||||
driver_opts:
|
|
||||||
type: none
|
|
||||||
o: "bind"
|
|
||||||
device: ${HOST_VOLUME_CERTS}
|
|
||||||
|
|
||||||
networks:
|
|
||||||
inception:
|
|
||||||
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
|
|
||||||
FROM alpine:3.15
|
|
||||||
|
|
||||||
# vim and bash for debug
|
|
||||||
RUN apk update && apk add \
|
|
||||||
mariadb \
|
|
||||||
mariadb-client \
|
|
||||||
vim bash \
|
|
||||||
&& \
|
|
||||||
rm -rf /var/cache/apk*
|
|
||||||
|
|
||||||
# config file .cnf :
|
|
||||||
COPY ./conf/mariadb-server.cnf.alpine /etc/my.cnf.d/mariadb-server.cnf
|
|
||||||
|
|
||||||
ARG DB_HOST
|
|
||||||
ARG DB_NAME
|
|
||||||
ARG DB_USER
|
|
||||||
ARG DB_PSWD
|
|
||||||
|
|
||||||
# init mysql database
|
|
||||||
RUN mysql_install_db --user=mysql --ldata=/var/lib/mysql && \
|
|
||||||
mkdir -p /var/run/mysqld && \
|
|
||||||
chown -R mysql:root /var/run/mysqld
|
|
||||||
|
|
||||||
# configure wp database
|
|
||||||
COPY ./conf/create_db.sql /usr/bin/create_db.sql
|
|
||||||
RUN sed -i "s/\${DB_HOST}/${DB_HOST}/g" /usr/bin/create_db.sql && \
|
|
||||||
sed -i "s/\${DB_NAME}/${DB_NAME}/g" /usr/bin/create_db.sql && \
|
|
||||||
sed -i "s/\${DB_USER}/${DB_USER}/g" /usr/bin/create_db.sql && \
|
|
||||||
sed -i "s/\${DB_PSWD}/${DB_PSWD}/g" /usr/bin/create_db.sql
|
|
||||||
|
|
||||||
ENTRYPOINT [ "mysqld", "--user=mysql", "--init-file=/usr/bin/create_db.sql" ]
|
|
||||||
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
# inception modifications :
|
|
||||||
#
|
|
||||||
# [mysqld] :
|
|
||||||
# < port = 3306
|
|
||||||
# > #port = 3306
|
|
||||||
# ---
|
|
||||||
# < #bind-address = 127.0.0.1
|
|
||||||
# > bind-address = 127.0.0.1
|
|
||||||
|
|
||||||
#
|
|
||||||
# These groups are read by MariaDB server.
|
|
||||||
# Use it for options that only the server (but not clients) should see
|
|
||||||
#
|
|
||||||
# See the examples of server my.cnf files in /usr/share/mysql
|
|
||||||
|
|
||||||
# this is read by the standalone daemon and embedded servers
|
|
||||||
[server]
|
|
||||||
|
|
||||||
# this is only for the mysqld standalone daemon
|
|
||||||
[mysqld]
|
|
||||||
|
|
||||||
#
|
|
||||||
# * Basic Settings
|
|
||||||
#
|
|
||||||
user = mysql
|
|
||||||
pid-file = /var/run/mysqld/mysqld.pid
|
|
||||||
socket = /var/run/mysqld/mysqld.sock
|
|
||||||
port = 3306
|
|
||||||
basedir = /usr
|
|
||||||
datadir = /var/lib/mysql
|
|
||||||
tmpdir = /tmp
|
|
||||||
lc-messages-dir = /usr/share/mysql
|
|
||||||
#skip-external-locking
|
|
||||||
|
|
||||||
# Instead of skip-networking the default is now to listen only on
|
|
||||||
# localhost which is more compatible and is not less secure.
|
|
||||||
#bind-address = 127.0.0.1
|
|
||||||
|
|
||||||
#
|
|
||||||
# * Fine Tuning
|
|
||||||
#
|
|
||||||
#key_buffer_size = 16M
|
|
||||||
#max_allowed_packet = 16M
|
|
||||||
#thread_stack = 192K
|
|
||||||
#thread_cache_size = 8
|
|
||||||
# This replaces the startup script and checks MyISAM tables if needed
|
|
||||||
# the first time they are touched
|
|
||||||
#myisam_recover_options = BACKUP
|
|
||||||
#max_connections = 100
|
|
||||||
#table_cache = 64
|
|
||||||
#thread_concurrency = 10
|
|
||||||
|
|
||||||
#
|
|
||||||
# * Query Cache Configuration
|
|
||||||
#
|
|
||||||
#query_cache_limit = 1M
|
|
||||||
query_cache_size = 16M
|
|
||||||
|
|
||||||
#
|
|
||||||
# * Logging and Replication
|
|
||||||
#
|
|
||||||
# Both location gets rotated by the cronjob.
|
|
||||||
# Be aware that this log type is a performance killer.
|
|
||||||
# As of 5.1 you can enable the log at runtime!
|
|
||||||
#general_log_file = /var/log/mysql/mysql.log
|
|
||||||
#general_log = 1
|
|
||||||
#
|
|
||||||
# Error log - should be very few entries.
|
|
||||||
#
|
|
||||||
log_error = /var/log/mysql/error.log
|
|
||||||
#
|
|
||||||
# Enable the slow query log to see queries with especially long duration
|
|
||||||
#slow_query_log_file = /var/log/mysql/mariadb-slow.log
|
|
||||||
#long_query_time = 10
|
|
||||||
#log_slow_rate_limit = 1000
|
|
||||||
#log_slow_verbosity = query_plan
|
|
||||||
#log-queries-not-using-indexes
|
|
||||||
#
|
|
||||||
# The following can be used as easy to replay backup logs or for replication.
|
|
||||||
# note: if you are setting up a replication slave, see README.Debian about
|
|
||||||
# other settings you may need to change.
|
|
||||||
#server-id = 1
|
|
||||||
#log_bin = /var/log/mysql/mysql-bin.log
|
|
||||||
expire_logs_days = 10
|
|
||||||
#max_binlog_size = 100M
|
|
||||||
#binlog_do_db = include_database_name
|
|
||||||
#binlog_ignore_db = exclude_database_name
|
|
||||||
|
|
||||||
#
|
|
||||||
# * Security Features
|
|
||||||
#
|
|
||||||
# Read the manual, too, if you want chroot!
|
|
||||||
#chroot = /var/lib/mysql/
|
|
||||||
#
|
|
||||||
# For generating SSL certificates you can use for example the GUI tool "tinyca".
|
|
||||||
#
|
|
||||||
#ssl-ca = /etc/mysql/cacert.pem
|
|
||||||
#ssl-cert = /etc/mysql/server-cert.pem
|
|
||||||
#ssl-key = /etc/mysql/server-key.pem
|
|
||||||
#
|
|
||||||
# Accept only connections using the latest and most secure TLS protocol version.
|
|
||||||
# ..when MariaDB is compiled with OpenSSL:
|
|
||||||
#ssl-cipher = TLSv1.2
|
|
||||||
# ..when MariaDB is compiled with YaSSL (default in Debian):
|
|
||||||
#ssl = on
|
|
||||||
|
|
||||||
#
|
|
||||||
# * Character sets
|
|
||||||
#
|
|
||||||
# MySQL/MariaDB default is Latin1, but in Debian we rather default to the full
|
|
||||||
# utf8 4-byte character set. See also client.cnf
|
|
||||||
#
|
|
||||||
character-set-server = utf8mb4
|
|
||||||
collation-server = utf8mb4_general_ci
|
|
||||||
|
|
||||||
#
|
|
||||||
# * InnoDB
|
|
||||||
#
|
|
||||||
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
|
|
||||||
# Read the manual for more InnoDB related options. There are many!
|
|
||||||
|
|
||||||
#
|
|
||||||
# * Unix socket authentication plugin is built-in since 10.0.22-6
|
|
||||||
#
|
|
||||||
# Needed so the root database user can authenticate without a password but
|
|
||||||
# only when running as the unix root user.
|
|
||||||
#
|
|
||||||
# Also available for other users if required.
|
|
||||||
# See https://mariadb.com/kb/en/unix_socket-authentication-plugin/
|
|
||||||
|
|
||||||
# this is only for embedded server
|
|
||||||
[embedded]
|
|
||||||
|
|
||||||
# This group is only read by MariaDB servers, not by MySQL.
|
|
||||||
# If you use the same .cnf file for MySQL and MariaDB,
|
|
||||||
# you can put MariaDB-only options here
|
|
||||||
[mariadb]
|
|
||||||
|
|
||||||
# This group is only read by MariaDB-10.3 servers.
|
|
||||||
# If you use the same .cnf file for MariaDB of different versions,
|
|
||||||
# use this group for options that older servers don't understand
|
|
||||||
[mariadb-10.3]
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
USE mysql;
|
|
||||||
|
|
||||||
CREATE DATABASE IF NOT EXISTS ${DB_NAME};
|
|
||||||
CREATE USER IF NOT EXISTS '${DB_USER}'@'%' IDENTIFIED BY '${DB_PSWD}';
|
|
||||||
GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' with grant option;
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
# https://wiki.alpinelinux.org/wiki/MariaDB
|
|
||||||
# inception modifications :
|
|
||||||
#
|
|
||||||
# [mysqld] :
|
|
||||||
# < socket=/run/mysqld/mysqld.sock
|
|
||||||
# >
|
|
||||||
#
|
|
||||||
# [mysqld] :
|
|
||||||
# < skip-networking = false
|
|
||||||
# > skip-networking
|
|
||||||
# ---
|
|
||||||
# < datadir = /var/lib/mysql
|
|
||||||
# >
|
|
||||||
# ---
|
|
||||||
# < port = 3306
|
|
||||||
# >
|
|
||||||
# ---
|
|
||||||
# < socket=/run/mysqld/mysqld.sock
|
|
||||||
# >
|
|
||||||
|
|
||||||
#
|
|
||||||
# These groups are read by MariaDB server.
|
|
||||||
# Use it for options that only the server (but not clients) should see
|
|
||||||
|
|
||||||
# this is read by the standalone daemon and embedded servers
|
|
||||||
[server]
|
|
||||||
socket=/run/mysqld/mysqld.sock
|
|
||||||
|
|
||||||
# this is only for the mysqld standalone daemon
|
|
||||||
[mysqld]
|
|
||||||
skip-networking = false
|
|
||||||
datadir = /var/lib/mysql
|
|
||||||
port = 3306
|
|
||||||
socket=/run/mysqld/mysqld.sock
|
|
||||||
|
|
||||||
# sock was in : /run/mysqld/mysqld.sock
|
|
||||||
# mariadb thought it was in : /var/lib/mysql/mysql.sock
|
|
||||||
# so I made : ln -s /run/mysqld/mysqld.sock /var/lib/mysql/mysql.sock
|
|
||||||
|
|
||||||
# Galera-related settings
|
|
||||||
[galera]
|
|
||||||
# Mandatory settings
|
|
||||||
#wsrep_on=ON
|
|
||||||
#wsrep_provider=
|
|
||||||
#wsrep_cluster_address=
|
|
||||||
#binlog_format=row
|
|
||||||
#default_storage_engine=InnoDB
|
|
||||||
#innodb_autoinc_lock_mode=2
|
|
||||||
#
|
|
||||||
# Allow server to accept connections on all interfaces.
|
|
||||||
#
|
|
||||||
#bind-address=0.0.0.0
|
|
||||||
#
|
|
||||||
# Optional setting
|
|
||||||
#wsrep_slave_threads=1
|
|
||||||
#innodb_flush_log_at_trx_commit=0
|
|
||||||
|
|
||||||
# this is only for embedded server
|
|
||||||
[embedded]
|
|
||||||
|
|
||||||
# This group is only read by MariaDB servers, not by MySQL.
|
|
||||||
# If you use the same .cnf file for MySQL and MariaDB,
|
|
||||||
# you can put MariaDB-only options here
|
|
||||||
[mariadb]
|
|
||||||
|
|
||||||
# This group is only read by MariaDB-10.5 servers.
|
|
||||||
# If you use the same .cnf file for MariaDB of different versions,
|
|
||||||
# use this group for options that older servers don't understand
|
|
||||||
[mariadb-10.5]
|
|
||||||
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
|
|
||||||
FROM alpine:3.15
|
|
||||||
|
|
||||||
# vim and bash for debug
|
|
||||||
RUN apk update && apk add \
|
|
||||||
nginx openssl \
|
|
||||||
vim bash \
|
|
||||||
&& \
|
|
||||||
rm -rf /var/cache/apk*
|
|
||||||
|
|
||||||
# nginx conf
|
|
||||||
COPY ./conf/nginx.conf.alpine /etc/nginx/nginx.conf
|
|
||||||
COPY ./conf/inception_nginx.conf /etc/nginx/http.d/
|
|
||||||
# dir for logs
|
|
||||||
RUN mkdir -p /var/log/nginx/
|
|
||||||
|
|
||||||
# create user www-data and assign it to group www-data
|
|
||||||
RUN adduser -S www-data && \
|
|
||||||
adduser www-data www-data && \
|
|
||||||
adduser www-data nginx && \
|
|
||||||
chmod +rwx /var/lib/nginx/tmp
|
|
||||||
|
|
||||||
ARG WP_URL
|
|
||||||
ARG MAX_UPLOAD_SIZE
|
|
||||||
ARG WP_VOLUME_DIR
|
|
||||||
ARG WP_VOLUME_PLUGINS
|
|
||||||
ARG NG_VOLUME_CERTS
|
|
||||||
|
|
||||||
# create and empty volumes dir
|
|
||||||
RUN mkdir -p ${WP_VOLUME_DIR} ${WP_VOLUME_PLUGINS} ${NG_VOLUME_CERTS} && \
|
|
||||||
rm -rf ${WP_VOLUME_DIR}/* ${WP_VOLUME_PLUGINS}/* ${NG_VOLUME_CERTS}/*
|
|
||||||
|
|
||||||
# replace WP_URL
|
|
||||||
RUN sed -i "s/\${WP_URL}/${WP_URL}/g" /etc/nginx/http.d/inception_nginx.conf
|
|
||||||
|
|
||||||
# replace max file size upload
|
|
||||||
RUN sed -i "s/\(client_max_body_size \).*\(m;\)/\1${MAX_UPLOAD_SIZE}\2/g" /etc/nginx/nginx.conf
|
|
||||||
|
|
||||||
# create ssl certificate
|
|
||||||
COPY ./conf/ssl ${NG_VOLUME_CERTS}
|
|
||||||
RUN if [ -z "$(ls -A ${NG_VOLUME_CERTS} 2>/dev/null)" ]; then \
|
|
||||||
mkdir ${NG_VOLUME_CERTS}/private ${NG_VOLUME_CERTS}/certs; \
|
|
||||||
openssl req -newkey rsa:2048 -nodes -x509 -days 365 \
|
|
||||||
-subj "/C=fr/ST=ile-de-france/L=paris/O=ljdp/OU=lejourdesprofs/CN=${WP_URL}" \
|
|
||||||
-keyout ${NG_VOLUME_CERTS}/private/${WP_URL}.key \
|
|
||||||
-out ${NG_VOLUME_CERTS}/certs/${WP_URL}.crt; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
ENTRYPOINT [ "nginx", "-g", "daemon off;" ]
|
|
||||||
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
##
|
|
||||||
# You should look at the following URL's in order to grasp a solid understanding
|
|
||||||
# of Nginx configuration files in order to fully unleash the power of Nginx.
|
|
||||||
# https://www.nginx.com/resources/wiki/start/
|
|
||||||
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
|
|
||||||
# https://wiki.debian.org/Nginx/DirectoryStructure
|
|
||||||
#
|
|
||||||
# In most cases, administrators will remove this file from sites-enabled/ and
|
|
||||||
# leave it as reference inside of sites-available where it will continue to be
|
|
||||||
# updated by the nginx packaging team.
|
|
||||||
#
|
|
||||||
# This file will automatically load configuration files provided by other
|
|
||||||
# applications, such as Drupal or Wordpress. These applications will be made
|
|
||||||
# available underneath a path with that package name, such as /drupal8.
|
|
||||||
#
|
|
||||||
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
|
|
||||||
##
|
|
||||||
|
|
||||||
# Default server configuration
|
|
||||||
#
|
|
||||||
server {
|
|
||||||
listen 80 default_server;
|
|
||||||
listen [::]:80 default_server;
|
|
||||||
|
|
||||||
# SSL configuration
|
|
||||||
#
|
|
||||||
# listen 443 ssl default_server;
|
|
||||||
# listen [::]:443 ssl default_server;
|
|
||||||
#
|
|
||||||
# Note: You should disable gzip for SSL traffic.
|
|
||||||
# See: https://bugs.debian.org/773332
|
|
||||||
#
|
|
||||||
# Read up on ssl_ciphers to ensure a secure configuration.
|
|
||||||
# See: https://bugs.debian.org/765782
|
|
||||||
#
|
|
||||||
# Self signed certs generated by the ssl-cert package
|
|
||||||
# Don't use them in a production server!
|
|
||||||
#
|
|
||||||
# include snippets/snakeoil.conf;
|
|
||||||
|
|
||||||
root /var/www/html;
|
|
||||||
|
|
||||||
# Add index.php to the list if you are using PHP
|
|
||||||
index index.html index.htm index.nginx-debian.html;
|
|
||||||
|
|
||||||
server_name _;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
# First attempt to serve request as file, then
|
|
||||||
# as directory, then fall back to displaying a 404.
|
|
||||||
try_files $uri $uri/ =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
# pass PHP scripts to FastCGI server
|
|
||||||
#
|
|
||||||
#location ~ \.php$ {
|
|
||||||
# include snippets/fastcgi-php.conf;
|
|
||||||
#
|
|
||||||
# # With php-fpm (or other unix sockets):
|
|
||||||
# fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
|
|
||||||
# # With php-cgi (or other tcp sockets):
|
|
||||||
# fastcgi_pass 127.0.0.1:9000;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# deny access to .htaccess files, if Apache's document root
|
|
||||||
# concurs with nginx's one
|
|
||||||
#
|
|
||||||
#location ~ /\.ht {
|
|
||||||
# deny all;
|
|
||||||
#}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Virtual Host configuration for example.com
|
|
||||||
#
|
|
||||||
# You can move that to a different file under sites-available/ and symlink that
|
|
||||||
# to sites-enabled/ to enable it.
|
|
||||||
#
|
|
||||||
#server {
|
|
||||||
# listen 80;
|
|
||||||
# listen [::]:80;
|
|
||||||
#
|
|
||||||
# server_name example.com;
|
|
||||||
#
|
|
||||||
# root /var/www/example.com;
|
|
||||||
# index index.html;
|
|
||||||
#
|
|
||||||
# location / {
|
|
||||||
# try_files $uri $uri/ =404;
|
|
||||||
# }
|
|
||||||
#}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
# doc : https://nginx.org/en/docs/dirindex.html
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443 ssl; # for ipv4, on port 443, specifying that accepted connections should works in ssl mode
|
|
||||||
listen [::]:443 ssl; # for ipv6
|
|
||||||
server_name ${WP_URL};
|
|
||||||
ssl_certificate /etc/ssl/certs/${WP_URL}.crt; # specifies the file with the ssl certificate (self signed here) generated by openssl
|
|
||||||
ssl_certificate_key /etc/ssl/private/${WP_URL}.key; # specifies the file with the secret key of the certificate
|
|
||||||
|
|
||||||
root /var/www/html/; # contains default nginx index.nginx-debian.html
|
|
||||||
index index.html index.php; # defines files that will be used as index (https://nginx.org/en/docs/http/ngx_http_index_module.html)
|
|
||||||
|
|
||||||
access_log /var/log/nginx/${WP_URL}.access.log;
|
|
||||||
error_log /var/log/nginx/${WP_URL}.error.log;
|
|
||||||
|
|
||||||
# use fastcgi for all php files
|
|
||||||
location ~ \.php$ {
|
|
||||||
fastcgi_pass wordpress:9000;
|
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
||||||
include fastcgi_params;
|
|
||||||
}
|
|
||||||
|
|
||||||
# followings are from :
|
|
||||||
# https://www.farinspace.com/wordpress-nginx-rewrite-rules/
|
|
||||||
|
|
||||||
# unless the request is for a valid file, send to bootstrap
|
|
||||||
# without this, permalinks changes don't work
|
|
||||||
if (!-e $request_filename) {
|
|
||||||
rewrite ^(.+)$ /index.php?q=$1 last;
|
|
||||||
}
|
|
||||||
|
|
||||||
## enforce NO www
|
|
||||||
#if ($host ~* ^www\.(.*)) {
|
|
||||||
# set $host_without_www $1;
|
|
||||||
# rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
|
|
||||||
#}
|
|
||||||
|
|
||||||
## catch all
|
|
||||||
#error_page 404 /index.php;
|
|
||||||
|
|
||||||
## deny access to apache .htaccess files
|
|
||||||
#location ~ /\.ht {
|
|
||||||
# deny all;
|
|
||||||
#}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
# inception modifications :
|
|
||||||
#
|
|
||||||
# user :
|
|
||||||
# < user www-data
|
|
||||||
# > user nginx
|
|
||||||
#
|
|
||||||
# protocols :
|
|
||||||
#
|
|
||||||
# < ssl_protocols TLSv1.2 TLSv1.3;
|
|
||||||
# > ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
|
|
||||||
|
|
||||||
# /etc/nginx/nginx.conf
|
|
||||||
|
|
||||||
user www-data;
|
|
||||||
|
|
||||||
# Set number of worker processes automatically based on number of CPU cores.
|
|
||||||
worker_processes auto;
|
|
||||||
|
|
||||||
# Enables the use of JIT for regular expressions to speed-up their processing.
|
|
||||||
pcre_jit on;
|
|
||||||
|
|
||||||
# Configures default error logger.
|
|
||||||
error_log /var/log/nginx/error.log warn;
|
|
||||||
|
|
||||||
# Includes files with directives to load dynamic modules.
|
|
||||||
include /etc/nginx/modules/*.conf;
|
|
||||||
|
|
||||||
# Uncomment to include files with config snippets into the root context.
|
|
||||||
# NOTE: This will be enabled by default in Alpine 3.15.
|
|
||||||
#include /etc/nginx/conf.d/*.conf;
|
|
||||||
|
|
||||||
events {
|
|
||||||
# The maximum number of simultaneous connections that can be opened by
|
|
||||||
# a worker process.
|
|
||||||
worker_connections 1024;
|
|
||||||
}
|
|
||||||
http {
|
|
||||||
# Includes mapping of file name extensions to MIME types of responses
|
|
||||||
# and defines the default type.
|
|
||||||
include /etc/nginx/mime.types;
|
|
||||||
default_type application/octet-stream;
|
|
||||||
|
|
||||||
# Name servers used to resolve names of upstream servers into addresses.
|
|
||||||
# It's also needed when using tcpsocket and udpsocket in Lua modules.
|
|
||||||
#resolver 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001;
|
|
||||||
|
|
||||||
# Don't tell nginx version to the clients. Default is 'on'.
|
|
||||||
server_tokens off;
|
|
||||||
|
|
||||||
# Specifies the maximum accepted body size of a client request, as
|
|
||||||
# indicated by the request header Content-Length. If the stated content
|
|
||||||
# length is greater than this size, then the client receives the HTTP
|
|
||||||
# error code 413. Set to 0 to disable. Default is '1m'.
|
|
||||||
client_max_body_size 1m;
|
|
||||||
|
|
||||||
# Sendfile copies data between one FD and other from within the kernel,
|
|
||||||
# which is more efficient than read() + write(). Default is off.
|
|
||||||
sendfile on;
|
|
||||||
|
|
||||||
# Causes nginx to attempt to send its HTTP response head in one packet,
|
|
||||||
# instead of using partial frames. Default is 'off'.
|
|
||||||
tcp_nopush on;
|
|
||||||
|
|
||||||
|
|
||||||
# Enables the specified protocols. Default is TLSv1 TLSv1.1 TLSv1.2.
|
|
||||||
# TIP: If you're not obligated to support ancient clients, remove TLSv1.1.
|
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
|
||||||
|
|
||||||
# Path of the file with Diffie-Hellman parameters for EDH ciphers.
|
|
||||||
# TIP: Generate with: `openssl dhparam -out /etc/ssl/nginx/dh2048.pem 2048`
|
|
||||||
#ssl_dhparam /etc/ssl/nginx/dh2048.pem;
|
|
||||||
|
|
||||||
# Specifies that our cipher suits should be preferred over client ciphers.
|
|
||||||
# Default is 'off'.
|
|
||||||
ssl_prefer_server_ciphers on;
|
|
||||||
|
|
||||||
# Enables a shared SSL cache with size that can hold around 8000 sessions.
|
|
||||||
# Default is 'none'.
|
|
||||||
ssl_session_cache shared:SSL:2m;
|
|
||||||
|
|
||||||
# Specifies a time during which a client may reuse the session parameters.
|
|
||||||
# Default is '5m'.
|
|
||||||
ssl_session_timeout 1h;
|
|
||||||
|
|
||||||
# Disable TLS session tickets (they are insecure). Default is 'on'.
|
|
||||||
ssl_session_tickets off;
|
|
||||||
|
|
||||||
|
|
||||||
# Enable gzipping of responses.
|
|
||||||
#gzip on;
|
|
||||||
|
|
||||||
# Set the Vary HTTP header as defined in the RFC 2616. Default is 'off'.
|
|
||||||
gzip_vary on;
|
|
||||||
|
|
||||||
# Helper variable for proxying websockets.
|
|
||||||
map $http_upgrade $connection_upgrade {
|
|
||||||
default upgrade;
|
|
||||||
'' close;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Specifies the main log format.
|
|
||||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
||||||
'$status $body_bytes_sent "$http_referer" '
|
|
||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
||||||
|
|
||||||
# Sets the path, format, and configuration for a buffered log write.
|
|
||||||
access_log /var/log/nginx/access.log main;
|
|
||||||
|
|
||||||
# Includes virtual hosts configs.
|
|
||||||
include /etc/nginx/http.d/*.conf;
|
|
||||||
}
|
|
||||||
|
|
||||||
# TIP: Uncomment if you use stream module.
|
|
||||||
#include /etc/nginx/stream.conf;
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
# inception modifications :
|
|
||||||
#
|
|
||||||
# ssl_protocols :
|
|
||||||
# < ssl_protocols TLSv1.3; # Dropping SSLv3, ref: POODLE
|
|
||||||
# > ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
|
|
||||||
# gzip :
|
|
||||||
# < gzip off;
|
|
||||||
# > gzip on;
|
|
||||||
# sites-enabled :
|
|
||||||
# < # include /etc/nginx/sites-enabled/*;
|
|
||||||
# > include /etc/nginx/sites-enabled/*;
|
|
||||||
# doc : https://nginx.org/en/docs/dirindex.html
|
|
||||||
|
|
||||||
user www-data; # process owner name, can be anything
|
|
||||||
worker_processes auto; # a worker is a process that handles incoming requests, auto to automatically adjust the number of processes available
|
|
||||||
pid /run/nginx.pid; # defines a file that will store the process id of the main process
|
|
||||||
include /etc/nginx/modules-enabled/*.conf; # include a file
|
|
||||||
|
|
||||||
events { # section for connection processing directives
|
|
||||||
worker_connections 768; # max number of connection that can be opened by a worker process
|
|
||||||
# multi_accept on;
|
|
||||||
}
|
|
||||||
|
|
||||||
http { # section for http server directives
|
|
||||||
##
|
|
||||||
# Basic Settings
|
|
||||||
##
|
|
||||||
|
|
||||||
sendfile on; # enable the use of linux sendfil() function, that transfer data directly betzeen fd, so withour copying to intermediate memory buffer, it increases performances in most cases (https://stackoverflow.com/questions/58066785/always-use-sendfile-with-nginx-on-linux)
|
|
||||||
tcp_nopush on; # enables the socket option TCP_CORK/TCP_NOPUSH, that allows to send packets filled with more datas (https://baus.net/on-tcp_cork/)
|
|
||||||
tcp_nodelay on; # opposit of TCP_CORK, TCP_NODELAY says the application to send datas as soon as it receives it, both options are exclusives but can work together in modern kernel (https://stackoverflow.com/questions/3761276/when-should-i-use-tcp-nodelay-and-when-tcp-cork)
|
|
||||||
keepalive_timeout 65; # in seconds, defines time before closing a connexion without activity
|
|
||||||
types_hash_max_size 2048; # maximum size for the list that stores duplicates of the hash table, size of the hash table is chosen accordingly (https://nginx.org/en/docs/hash.html, hash table : https://www.youtube.com/watch?v=KyUTuwz_b7Q)
|
|
||||||
# server_tokens off;
|
|
||||||
|
|
||||||
# server_names_hash_bucket_size 64;
|
|
||||||
# server_name_in_redirect off;
|
|
||||||
|
|
||||||
include /etc/nginx/mime.types; # include a file
|
|
||||||
default_type application/octet-stream; # defines the default MIME type (default is text/plain)
|
|
||||||
|
|
||||||
##
|
|
||||||
# SSL Settings
|
|
||||||
##
|
|
||||||
|
|
||||||
ssl_protocols TLSv1.3; # Dropping SSLv3, ref: POODLE # enables the specified protocols. The TLSv1.1 and TLSv1.2 parameters works only when OpenSSL 1.0.1 or higher is used, and the TLSv1.3 only when OpenSSL 1.1.1 or higher is used
|
|
||||||
ssl_prefer_server_ciphers on; # Specifies that server ciphers should be preferred over client ciphers when using the SSLv3 and TLS protocols (a cipher is "an algorithm for performing encryption or decryption, a series of [...] steps that can be followed as a procedure" https://en.wikipedia.org/wiki/Cipher_suite)
|
|
||||||
|
|
||||||
##
|
|
||||||
# Logging Settings
|
|
||||||
##
|
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log; # defines where to write the access logs. if gzip is used, the log will be buffered
|
|
||||||
error_log /var/log/nginx/error.log; # defines where to write the error logs. if gzip is used, the log will be buffered
|
|
||||||
|
|
||||||
##
|
|
||||||
# Gzip Settings
|
|
||||||
##
|
|
||||||
|
|
||||||
gzip off; # enable gzipping of responses. gzip is an algorithm that compress the data (disabled for security reasons : https://bugs.debian.org/773332)
|
|
||||||
|
|
||||||
# gzip_vary on;
|
|
||||||
# gzip_proxied any;
|
|
||||||
# gzip_comp_level 6;
|
|
||||||
# gzip_buffers 16 8k;
|
|
||||||
# gzip_http_version 1.1;
|
|
||||||
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
||||||
|
|
||||||
##
|
|
||||||
# Virtual Host Configs
|
|
||||||
##
|
|
||||||
|
|
||||||
include /etc/nginx/conf.d/*.conf; # include the *.conf files found in conf.d folder. do the same as "sites-enabled" with another approach : you put your .conf files for the site inside this folder, and if you want to disable a config file you just rename it to no have a .conf suffix
|
|
||||||
# include /etc/nginx/sites-enabled/*; # include all the (symlink) files found in sites-enabled folder. do the same as "conf.d" with another approach : you put all your configurations files into a "/etc/nginx/sites-available/" folder, and you put symlinks of a selection of thoses files that you want to use for the site, into "/etc/nginx/sites-enabled/" folder (bad practice : https://serverfault.com/questions/527630/difference-in-sites-available-vs-sites-enabled-vs-conf-d-directories-nginx#answer-870709)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#mail {
|
|
||||||
# # See sample authentication script at:
|
|
||||||
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
|
|
||||||
#
|
|
||||||
# # auth_http localhost/auth.php;
|
|
||||||
# # pop3_capabilities "TOP" "USER";
|
|
||||||
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
|
|
||||||
#
|
|
||||||
# server {
|
|
||||||
# listen localhost:110;
|
|
||||||
# protocol pop3;
|
|
||||||
# proxy on;
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# server {
|
|
||||||
# listen localhost:143;
|
|
||||||
# protocol imap;
|
|
||||||
# proxy on;
|
|
||||||
# }
|
|
||||||
#}
|
|
||||||
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
|
|
||||||
FROM alpine:3.15
|
|
||||||
|
|
||||||
# all packages (from : https://mricher.fr/post/all-php-modules-for-alpine/)
|
|
||||||
# apk update && apk add php7-bcmath php7-bz2 php7-calendar php7-cgi php7-common php7-ctype php7-curl php7-dba php7-dbg php7-dev php7-doc php7-dom php7-embed php7-enchant php7-exif php7-fileinfo php7-fpm php7-ftp php7-gd php7-gettext php7-gmp php7-iconv php7-imap php7-intl php7-json php7-ldap php7-litespeed php7-mbstring php7-mysqli php7-mysqlnd php7-odbc php7-opcache php7-openssl php7-pcntl php7-pdo php7-pdo_dblib php7-pdo_mysql php7-pdo_odbc php7-pdo_pgsql php7-pdo_sqlite php7-pear php7-pgsql php7-phar php7-phpdbg php7-posix php7-pspell php7-recode php7-session php7-shmop php7-simplexml php7-snmp php7-soap php7-sockets php7-sodium php7-sqlite3 php7-static php7-sysvmsg php7-sysvsem php7-sysvshm php7-tidy php7-tokenizer php7-wddx php7-xml php7-xmlreader php7-xmlrpc php7-xmlwriter php7-xsl php7-zip php7-pecl-xhprof php7-pecl-xhprof-assets php7-pecl-uuid php7-pecl-protobuf php7-pecl-xdebug php7-pecl-memcached php7-pecl-oauth php7-pecl-ssh2 php7-pecl-imagick php7-pecl-imagick-dev php7-pecl-vips php7-pecl-ast php7-pecl-event php7-pecl-redis php7-phalcon php7-pecl-apcu php7-pecl-timezonedb php7-pecl-mcrypt php7-pecl-mailparse php7-pecl-msgpack php7-pecl-yaml php7-pecl-zmq php7-brotli php7-pecl-amqp php7-pecl-couchbase php7-pecl-gmagick php7-pecl-igbinary php7-pecl-lzf
|
|
||||||
# bash and vim for debug
|
|
||||||
RUN apk update && apk add \
|
|
||||||
php7 \
|
|
||||||
php7-fpm \
|
|
||||||
php7-mysqli \
|
|
||||||
php7-phar \
|
|
||||||
php7-json \
|
|
||||||
php7-iconv \
|
|
||||||
\
|
|
||||||
php7-tokenizer \
|
|
||||||
php7-zip \
|
|
||||||
php7-dom \
|
|
||||||
php7-curl \
|
|
||||||
\
|
|
||||||
mariadb-client \
|
|
||||||
curl \
|
|
||||||
bash vim
|
|
||||||
RUN rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# fpm config
|
|
||||||
COPY ./conf/www.conf /etc/php7/php-fpm.d/
|
|
||||||
RUN mkdir /run/php/
|
|
||||||
|
|
||||||
ARG WP_VOLUME_DIR
|
|
||||||
ARG WP_VOLUME_PLUGINS
|
|
||||||
ARG MAX_UPLOAD_SIZE
|
|
||||||
ARG EXECUTION_TIME
|
|
||||||
|
|
||||||
# create and empty volumes dir
|
|
||||||
# WP_VOLUME_DIR=/var/www/html
|
|
||||||
# WP_VOLUME_PLUGINS=/home/www-data
|
|
||||||
RUN mkdir -p ${WP_VOLUME_DIR} ${WP_VOLUME_PLUGINS} && \
|
|
||||||
rm -rf ${WP_VOLUME_DIR}/* ${WP_VOLUME_PLUGINS}/*
|
|
||||||
|
|
||||||
# replace max file size upload and execution time
|
|
||||||
RUN sed -i "s/\(upload_max_filesize = \).*\(M\)/\1${MAX_UPLOAD_SIZE}\2/g" /etc/php7/php.ini && \
|
|
||||||
sed -i "s/\(post_max_size = \).*\(M\)/\1${MAX_UPLOAD_SIZE}\2/g" /etc/php7/php.ini && \
|
|
||||||
sed -i "s/\(max_execution_time = \).*/\1${EXECUTION_TIME}/g" /etc/php7/php.ini
|
|
||||||
|
|
||||||
# create www-data user and add to group
|
|
||||||
RUN adduser -S www-data && \
|
|
||||||
adduser www-data www-data
|
|
||||||
|
|
||||||
ENV PHP_VERSION="php-fpm7"
|
|
||||||
|
|
||||||
# install wp-cli : https://wp-cli.org/#installing
|
|
||||||
# bug with wp commands : https://github.com/wp-cli/config-command/issues/31
|
|
||||||
# change : mv wp-cli.phar /usr/local/bin/wp -> cp wp-cli.phar /usr/local/bin/wp
|
|
||||||
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar &&\
|
|
||||||
chmod +x wp-cli.phar && \
|
|
||||||
cp wp-cli.phar /usr/local/bin/wp
|
|
||||||
|
|
||||||
COPY ./conf/wp_entrypoint.sh ./
|
|
||||||
|
|
||||||
ENTRYPOINT [ "sh", "wp_entrypoint.sh" ]
|
|
||||||
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
GRAY="\e[0;30m"
|
|
||||||
RED="\e[0;31m"
|
|
||||||
GREEN="\e[0;32m"
|
|
||||||
YELLOW="\e[0;33m"
|
|
||||||
BLUE="\e[0;34m"
|
|
||||||
PURPLE="\e[0;35m"
|
|
||||||
CYAN="\e[0;36m"
|
|
||||||
WHITE="\e[0;37m"
|
|
||||||
RESET="\e[0m"
|
|
||||||
|
|
||||||
# install wordpress with cli : https://make.wordpress.org/cli/handbook/how-to-install/
|
|
||||||
# commands : https://developer.wordpress.org/cli/commands/
|
|
||||||
# bug with wp commands : https://github.com/wp-cli/config-command/issues/31
|
|
||||||
# -> use `php wp-cli.phar` instead of `wp` as command
|
|
||||||
|
|
||||||
echo -e ${YELLOW}download wordpress :${RESET}
|
|
||||||
if ! wp core version --path="${WP_VOLUME_DIR}" 2> /dev/null
|
|
||||||
then
|
|
||||||
echo -e ${YELLOW}wp core download...${RESET}
|
|
||||||
mkdir -p ${WP_VOLUME_DIR}
|
|
||||||
#wp core download --path="${WP_VOLUME_DIR}" --allow-root
|
|
||||||
php wp-cli.phar core download --path="${WP_VOLUME_DIR}" --allow-root
|
|
||||||
else
|
|
||||||
echo -e ${GREEN}already there !${RESET}
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ! wp core is-installed --path="${WP_VOLUME_DIR}" 2> /dev/null
|
|
||||||
then
|
|
||||||
echo -e ${YELLOW}installing...${RESET}
|
|
||||||
|
|
||||||
#wp config create \
|
|
||||||
echo -e ${YELLOW}wp config create...${RESET}
|
|
||||||
php wp-cli.phar config create \
|
|
||||||
--dbhost="${DB_HOST}" \
|
|
||||||
--dbname="${DB_NAME}" \
|
|
||||||
--dbuser="${DB_USER}" \
|
|
||||||
--dbpass="${DB_PSWD}" \
|
|
||||||
--path="${WP_VOLUME_DIR}" --allow-root
|
|
||||||
|
|
||||||
#wp core install \
|
|
||||||
echo -e ${YELLOW}wp core install...${RESET}
|
|
||||||
php wp-cli.phar core install \
|
|
||||||
--url="${WP_URL}" \
|
|
||||||
--title="${WP_TITLE}" \
|
|
||||||
--admin_user="${WP_ADMIN}" \
|
|
||||||
--admin_email="${WP_ADMIN_EMAIL}" \
|
|
||||||
--admin_password="${WP_ADMIN_PSWD}" \
|
|
||||||
--skip-email \
|
|
||||||
--path="${WP_VOLUME_DIR}" --allow-root
|
|
||||||
|
|
||||||
#wp user create \
|
|
||||||
echo -e ${YELLOW}wp user create...${RESET}
|
|
||||||
php wp-cli.phar user create \
|
|
||||||
"${WP_USER}" "${WP_USER_EMAIL}" \
|
|
||||||
--user_pass="${WP_USER_PSWD}" \
|
|
||||||
--path="${WP_VOLUME_DIR}" --allow-root
|
|
||||||
|
|
||||||
echo -e ${YELLOW}chown and chmod...${RESET}
|
|
||||||
chown -R www-data:www-data /var/www/*
|
|
||||||
chmod 755 -R /var/www/*
|
|
||||||
|
|
||||||
# echo -e ${YELLOW}plugins...${RESET}
|
|
||||||
# plugins=$(ls ${WP_VOLUME_PLUGINS})
|
|
||||||
# for dir in $plugins; do
|
|
||||||
# ln -s ${WP_VOLUME_PLUGINS}/$dir ${WP_VOLUME_DIR}/wp-content/plugins/$dir
|
|
||||||
# done
|
|
||||||
|
|
||||||
echo -e ${GREEN}done !${RESET}
|
|
||||||
|
|
||||||
else
|
|
||||||
echo -e ${GREEN}wp is installed${RESET}
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
exec "${PHP_VERSION}" -FR
|
|
||||||
|
|
||||||
@@ -1,446 +0,0 @@
|
|||||||
; inception modifications :
|
|
||||||
;
|
|
||||||
; listen :
|
|
||||||
; < listen = wordpress:9000
|
|
||||||
; > listen = /run/php/php7.3-fpm.sock
|
|
||||||
|
|
||||||
|
|
||||||
; Start a new pool named 'www'.
|
|
||||||
; the variable $pool can be used in any directive and will be replaced by the
|
|
||||||
; pool name ('www' here)
|
|
||||||
[www]
|
|
||||||
|
|
||||||
; Per pool prefix
|
|
||||||
; It only applies on the following directives:
|
|
||||||
; - 'access.log'
|
|
||||||
; - 'slowlog'
|
|
||||||
; - 'listen' (unixsocket)
|
|
||||||
; - 'chroot'
|
|
||||||
; - 'chdir'
|
|
||||||
; - 'php_values'
|
|
||||||
; - 'php_admin_values'
|
|
||||||
; When not set, the global prefix (or /usr) applies instead.
|
|
||||||
; Note: This directive can also be relative to the global prefix.
|
|
||||||
; Default Value: none
|
|
||||||
;prefix = /path/to/pools/$pool
|
|
||||||
|
|
||||||
; Unix user/group of processes
|
|
||||||
; Note: The user is mandatory. If the group is not set, the default user's group
|
|
||||||
; will be used.
|
|
||||||
user = www-data
|
|
||||||
group = www-data
|
|
||||||
|
|
||||||
; The address on which to accept FastCGI requests.
|
|
||||||
; Valid syntaxes are:
|
|
||||||
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
|
|
||||||
; a specific port;
|
|
||||||
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
|
|
||||||
; a specific port;
|
|
||||||
; 'port' - to listen on a TCP socket to all addresses
|
|
||||||
; (IPv6 and IPv4-mapped) on a specific port;
|
|
||||||
; '/path/to/unix/socket' - to listen on a unix socket.
|
|
||||||
; Note: This value is mandatory.
|
|
||||||
listen = wordpress:9000
|
|
||||||
|
|
||||||
; Set listen(2) backlog.
|
|
||||||
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
|
|
||||||
;listen.backlog = 511
|
|
||||||
|
|
||||||
; Set permissions for unix socket, if one is used. In Linux, read/write
|
|
||||||
; permissions must be set in order to allow connections from a web server. Many
|
|
||||||
; BSD-derived systems allow connections regardless of permissions. The owner
|
|
||||||
; and group can be specified either by name or by their numeric IDs.
|
|
||||||
; Default Values: user and group are set as the running user
|
|
||||||
; mode is set to 0660
|
|
||||||
listen.owner = www-data
|
|
||||||
listen.group = www-data
|
|
||||||
;listen.mode = 0660
|
|
||||||
; When POSIX Access Control Lists are supported you can set them using
|
|
||||||
; these options, value is a comma separated list of user/group names.
|
|
||||||
; When set, listen.owner and listen.group are ignored
|
|
||||||
;listen.acl_users =
|
|
||||||
;listen.acl_groups =
|
|
||||||
|
|
||||||
; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
|
|
||||||
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
|
|
||||||
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
|
|
||||||
; must be separated by a comma. If this value is left blank, connections will be
|
|
||||||
; accepted from any ip address.
|
|
||||||
; Default Value: any
|
|
||||||
;listen.allowed_clients = 127.0.0.1
|
|
||||||
|
|
||||||
; Specify the nice(2) priority to apply to the pool processes (only if set)
|
|
||||||
; The value can vary from -19 (highest priority) to 20 (lower priority)
|
|
||||||
; Note: - It will only work if the FPM master process is launched as root
|
|
||||||
; - The pool processes will inherit the master process priority
|
|
||||||
; unless it specified otherwise
|
|
||||||
; Default Value: no set
|
|
||||||
; process.priority = -19
|
|
||||||
|
|
||||||
; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
|
|
||||||
; or group is differrent than the master process user. It allows to create process
|
|
||||||
; core dump and ptrace the process for the pool user.
|
|
||||||
; Default Value: no
|
|
||||||
; process.dumpable = yes
|
|
||||||
|
|
||||||
; Choose how the process manager will control the number of child processes.
|
|
||||||
; Possible Values:
|
|
||||||
; static - a fixed number (pm.max_children) of child processes;
|
|
||||||
; dynamic - the number of child processes are set dynamically based on the
|
|
||||||
; following directives. With this process management, there will be
|
|
||||||
; always at least 1 children.
|
|
||||||
; pm.max_children - the maximum number of children that can
|
|
||||||
; be alive at the same time.
|
|
||||||
; pm.start_servers - the number of children created on startup.
|
|
||||||
; pm.min_spare_servers - the minimum number of children in 'idle'
|
|
||||||
; state (waiting to process). If the number
|
|
||||||
; of 'idle' processes is less than this
|
|
||||||
; number then some children will be created.
|
|
||||||
; pm.max_spare_servers - the maximum number of children in 'idle'
|
|
||||||
; state (waiting to process). If the number
|
|
||||||
; of 'idle' processes is greater than this
|
|
||||||
; number then some children will be killed.
|
|
||||||
; ondemand - no children are created at startup. Children will be forked when
|
|
||||||
; new requests will connect. The following parameter are used:
|
|
||||||
; pm.max_children - the maximum number of children that
|
|
||||||
; can be alive at the same time.
|
|
||||||
; pm.process_idle_timeout - The number of seconds after which
|
|
||||||
; an idle process will be killed.
|
|
||||||
; Note: This value is mandatory.
|
|
||||||
pm = dynamic
|
|
||||||
|
|
||||||
; The number of child processes to be created when pm is set to 'static' and the
|
|
||||||
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
|
|
||||||
; This value sets the limit on the number of simultaneous requests that will be
|
|
||||||
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
|
|
||||||
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
|
|
||||||
; CGI. The below defaults are based on a server without much resources. Don't
|
|
||||||
; forget to tweak pm.* to fit your needs.
|
|
||||||
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
|
|
||||||
; Note: This value is mandatory.
|
|
||||||
pm.max_children = 5
|
|
||||||
|
|
||||||
; The number of child processes created on startup.
|
|
||||||
; Note: Used only when pm is set to 'dynamic'
|
|
||||||
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
|
|
||||||
pm.start_servers = 2
|
|
||||||
|
|
||||||
; The desired minimum number of idle server processes.
|
|
||||||
; Note: Used only when pm is set to 'dynamic'
|
|
||||||
; Note: Mandatory when pm is set to 'dynamic'
|
|
||||||
pm.min_spare_servers = 1
|
|
||||||
|
|
||||||
; The desired maximum number of idle server processes.
|
|
||||||
; Note: Used only when pm is set to 'dynamic'
|
|
||||||
; Note: Mandatory when pm is set to 'dynamic'
|
|
||||||
pm.max_spare_servers = 3
|
|
||||||
|
|
||||||
; The number of seconds after which an idle process will be killed.
|
|
||||||
; Note: Used only when pm is set to 'ondemand'
|
|
||||||
; Default Value: 10s
|
|
||||||
;pm.process_idle_timeout = 10s;
|
|
||||||
|
|
||||||
; The number of requests each child process should execute before respawning.
|
|
||||||
; This can be useful to work around memory leaks in 3rd party libraries. For
|
|
||||||
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
|
|
||||||
; Default Value: 0
|
|
||||||
;pm.max_requests = 500
|
|
||||||
|
|
||||||
; The URI to view the FPM status page. If this value is not set, no URI will be
|
|
||||||
; recognized as a status page. It shows the following informations:
|
|
||||||
; pool - the name of the pool;
|
|
||||||
; process manager - static, dynamic or ondemand;
|
|
||||||
; start time - the date and time FPM has started;
|
|
||||||
; start since - number of seconds since FPM has started;
|
|
||||||
; accepted conn - the number of request accepted by the pool;
|
|
||||||
; listen queue - the number of request in the queue of pending
|
|
||||||
; connections (see backlog in listen(2));
|
|
||||||
; max listen queue - the maximum number of requests in the queue
|
|
||||||
; of pending connections since FPM has started;
|
|
||||||
; listen queue len - the size of the socket queue of pending connections;
|
|
||||||
; idle processes - the number of idle processes;
|
|
||||||
; active processes - the number of active processes;
|
|
||||||
; total processes - the number of idle + active processes;
|
|
||||||
; max active processes - the maximum number of active processes since FPM
|
|
||||||
; has started;
|
|
||||||
; max children reached - number of times, the process limit has been reached,
|
|
||||||
; when pm tries to start more children (works only for
|
|
||||||
; pm 'dynamic' and 'ondemand');
|
|
||||||
; Value are updated in real time.
|
|
||||||
; Example output:
|
|
||||||
; pool: www
|
|
||||||
; process manager: static
|
|
||||||
; start time: 01/Jul/2011:17:53:49 +0200
|
|
||||||
; start since: 62636
|
|
||||||
; accepted conn: 190460
|
|
||||||
; listen queue: 0
|
|
||||||
; max listen queue: 1
|
|
||||||
; listen queue len: 42
|
|
||||||
; idle processes: 4
|
|
||||||
; active processes: 11
|
|
||||||
; total processes: 15
|
|
||||||
; max active processes: 12
|
|
||||||
; max children reached: 0
|
|
||||||
;
|
|
||||||
; By default the status page output is formatted as text/plain. Passing either
|
|
||||||
; 'html', 'xml' or 'json' in the query string will return the corresponding
|
|
||||||
; output syntax. Example:
|
|
||||||
; http://www.foo.bar/status
|
|
||||||
; http://www.foo.bar/status?json
|
|
||||||
; http://www.foo.bar/status?html
|
|
||||||
; http://www.foo.bar/status?xml
|
|
||||||
;
|
|
||||||
; By default the status page only outputs short status. Passing 'full' in the
|
|
||||||
; query string will also return status for each pool process.
|
|
||||||
; Example:
|
|
||||||
; http://www.foo.bar/status?full
|
|
||||||
; http://www.foo.bar/status?json&full
|
|
||||||
; http://www.foo.bar/status?html&full
|
|
||||||
; http://www.foo.bar/status?xml&full
|
|
||||||
; The Full status returns for each process:
|
|
||||||
; pid - the PID of the process;
|
|
||||||
; state - the state of the process (Idle, Running, ...);
|
|
||||||
; start time - the date and time the process has started;
|
|
||||||
; start since - the number of seconds since the process has started;
|
|
||||||
; requests - the number of requests the process has served;
|
|
||||||
; request duration - the duration in µs of the requests;
|
|
||||||
; request method - the request method (GET, POST, ...);
|
|
||||||
; request URI - the request URI with the query string;
|
|
||||||
; content length - the content length of the request (only with POST);
|
|
||||||
; user - the user (PHP_AUTH_USER) (or '-' if not set);
|
|
||||||
; script - the main script called (or '-' if not set);
|
|
||||||
; last request cpu - the %cpu the last request consumed
|
|
||||||
; it's always 0 if the process is not in Idle state
|
|
||||||
; because CPU calculation is done when the request
|
|
||||||
; processing has terminated;
|
|
||||||
; last request memory - the max amount of memory the last request consumed
|
|
||||||
; it's always 0 if the process is not in Idle state
|
|
||||||
; because memory calculation is done when the request
|
|
||||||
; processing has terminated;
|
|
||||||
; If the process is in Idle state, then informations are related to the
|
|
||||||
; last request the process has served. Otherwise informations are related to
|
|
||||||
; the current request being served.
|
|
||||||
; Example output:
|
|
||||||
; ************************
|
|
||||||
; pid: 31330
|
|
||||||
; state: Running
|
|
||||||
; start time: 01/Jul/2011:17:53:49 +0200
|
|
||||||
; start since: 63087
|
|
||||||
; requests: 12808
|
|
||||||
; request duration: 1250261
|
|
||||||
; request method: GET
|
|
||||||
; request URI: /test_mem.php?N=10000
|
|
||||||
; content length: 0
|
|
||||||
; user: -
|
|
||||||
; script: /home/fat/web/docs/php/test_mem.php
|
|
||||||
; last request cpu: 0.00
|
|
||||||
; last request memory: 0
|
|
||||||
;
|
|
||||||
; Note: There is a real-time FPM status monitoring sample web page available
|
|
||||||
; It's available in: /usr/share/php/7.3/fpm/status.html
|
|
||||||
;
|
|
||||||
; Note: The value must start with a leading slash (/). The value can be
|
|
||||||
; anything, but it may not be a good idea to use the .php extension or it
|
|
||||||
; may conflict with a real PHP file.
|
|
||||||
; Default Value: not set
|
|
||||||
;pm.status_path = /status
|
|
||||||
|
|
||||||
; The ping URI to call the monitoring page of FPM. If this value is not set, no
|
|
||||||
; URI will be recognized as a ping page. This could be used to test from outside
|
|
||||||
; that FPM is alive and responding, or to
|
|
||||||
; - create a graph of FPM availability (rrd or such);
|
|
||||||
; - remove a server from a group if it is not responding (load balancing);
|
|
||||||
; - trigger alerts for the operating team (24/7).
|
|
||||||
; Note: The value must start with a leading slash (/). The value can be
|
|
||||||
; anything, but it may not be a good idea to use the .php extension or it
|
|
||||||
; may conflict with a real PHP file.
|
|
||||||
; Default Value: not set
|
|
||||||
;ping.path = /ping
|
|
||||||
|
|
||||||
; This directive may be used to customize the response of a ping request. The
|
|
||||||
; response is formatted as text/plain with a 200 response code.
|
|
||||||
; Default Value: pong
|
|
||||||
;ping.response = pong
|
|
||||||
|
|
||||||
; The access log file
|
|
||||||
; Default: not set
|
|
||||||
;access.log = log/$pool.access.log
|
|
||||||
|
|
||||||
; The access log format.
|
|
||||||
; The following syntax is allowed
|
|
||||||
; %%: the '%' character
|
|
||||||
; %C: %CPU used by the request
|
|
||||||
; it can accept the following format:
|
|
||||||
; - %{user}C for user CPU only
|
|
||||||
; - %{system}C for system CPU only
|
|
||||||
; - %{total}C for user + system CPU (default)
|
|
||||||
; %d: time taken to serve the request
|
|
||||||
; it can accept the following format:
|
|
||||||
; - %{seconds}d (default)
|
|
||||||
; - %{miliseconds}d
|
|
||||||
; - %{mili}d
|
|
||||||
; - %{microseconds}d
|
|
||||||
; - %{micro}d
|
|
||||||
; %e: an environment variable (same as $_ENV or $_SERVER)
|
|
||||||
; it must be associated with embraces to specify the name of the env
|
|
||||||
; variable. Some exemples:
|
|
||||||
; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
|
|
||||||
; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
|
|
||||||
; %f: script filename
|
|
||||||
; %l: content-length of the request (for POST request only)
|
|
||||||
; %m: request method
|
|
||||||
; %M: peak of memory allocated by PHP
|
|
||||||
; it can accept the following format:
|
|
||||||
; - %{bytes}M (default)
|
|
||||||
; - %{kilobytes}M
|
|
||||||
; - %{kilo}M
|
|
||||||
; - %{megabytes}M
|
|
||||||
; - %{mega}M
|
|
||||||
; %n: pool name
|
|
||||||
; %o: output header
|
|
||||||
; it must be associated with embraces to specify the name of the header:
|
|
||||||
; - %{Content-Type}o
|
|
||||||
; - %{X-Powered-By}o
|
|
||||||
; - %{Transfert-Encoding}o
|
|
||||||
; - ....
|
|
||||||
; %p: PID of the child that serviced the request
|
|
||||||
; %P: PID of the parent of the child that serviced the request
|
|
||||||
; %q: the query string
|
|
||||||
; %Q: the '?' character if query string exists
|
|
||||||
; %r: the request URI (without the query string, see %q and %Q)
|
|
||||||
; %R: remote IP address
|
|
||||||
; %s: status (response code)
|
|
||||||
; %t: server time the request was received
|
|
||||||
; it can accept a strftime(3) format:
|
|
||||||
; %d/%b/%Y:%H:%M:%S %z (default)
|
|
||||||
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
|
|
||||||
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
|
||||||
; %T: time the log has been written (the request has finished)
|
|
||||||
; it can accept a strftime(3) format:
|
|
||||||
; %d/%b/%Y:%H:%M:%S %z (default)
|
|
||||||
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
|
|
||||||
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
|
||||||
; %u: remote user
|
|
||||||
;
|
|
||||||
; Default: "%R - %u %t \"%m %r\" %s"
|
|
||||||
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
|
|
||||||
|
|
||||||
; The log file for slow requests
|
|
||||||
; Default Value: not set
|
|
||||||
; Note: slowlog is mandatory if request_slowlog_timeout is set
|
|
||||||
;slowlog = log/$pool.log.slow
|
|
||||||
|
|
||||||
; The timeout for serving a single request after which a PHP backtrace will be
|
|
||||||
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
|
|
||||||
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
|
|
||||||
; Default Value: 0
|
|
||||||
;request_slowlog_timeout = 0
|
|
||||||
|
|
||||||
; Depth of slow log stack trace.
|
|
||||||
; Default Value: 20
|
|
||||||
;request_slowlog_trace_depth = 20
|
|
||||||
|
|
||||||
; The timeout for serving a single request after which the worker process will
|
|
||||||
; be killed. This option should be used when the 'max_execution_time' ini option
|
|
||||||
; does not stop script execution for some reason. A value of '0' means 'off'.
|
|
||||||
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
|
|
||||||
; Default Value: 0
|
|
||||||
;request_terminate_timeout = 0
|
|
||||||
|
|
||||||
; The timeout set by 'request_terminate_timeout' ini option is not engaged after
|
|
||||||
; application calls 'fastcgi_finish_request' or when application has finished and
|
|
||||||
; shutdown functions are being called (registered via register_shutdown_function).
|
|
||||||
; This option will enable timeout limit to be applied unconditionally
|
|
||||||
; even in such cases.
|
|
||||||
; Default Value: no
|
|
||||||
;request_terminate_timeout_track_finished = no
|
|
||||||
|
|
||||||
; Set open file descriptor rlimit.
|
|
||||||
; Default Value: system defined value
|
|
||||||
;rlimit_files = 1024
|
|
||||||
|
|
||||||
; Set max core size rlimit.
|
|
||||||
; Possible Values: 'unlimited' or an integer greater or equal to 0
|
|
||||||
; Default Value: system defined value
|
|
||||||
;rlimit_core = 0
|
|
||||||
|
|
||||||
; Chroot to this directory at the start. This value must be defined as an
|
|
||||||
; absolute path. When this value is not set, chroot is not used.
|
|
||||||
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
|
|
||||||
; of its subdirectories. If the pool prefix is not set, the global prefix
|
|
||||||
; will be used instead.
|
|
||||||
; Note: chrooting is a great security feature and should be used whenever
|
|
||||||
; possible. However, all PHP paths will be relative to the chroot
|
|
||||||
; (error_log, sessions.save_path, ...).
|
|
||||||
; Default Value: not set
|
|
||||||
;chroot =
|
|
||||||
|
|
||||||
; Chdir to this directory at the start.
|
|
||||||
; Note: relative path can be used.
|
|
||||||
; Default Value: current directory or / when chroot
|
|
||||||
;chdir = /var/www
|
|
||||||
|
|
||||||
; Redirect worker stdout and stderr into main error log. If not set, stdout and
|
|
||||||
; stderr will be redirected to /dev/null according to FastCGI specs.
|
|
||||||
; Note: on highloaded environement, this can cause some delay in the page
|
|
||||||
; process time (several ms).
|
|
||||||
; Default Value: no
|
|
||||||
;catch_workers_output = yes
|
|
||||||
|
|
||||||
; Decorate worker output with prefix and suffix containing information about
|
|
||||||
; the child that writes to the log and if stdout or stderr is used as well as
|
|
||||||
; log level and time. This options is used only if catch_workers_output is yes.
|
|
||||||
; Settings to "no" will output data as written to the stdout or stderr.
|
|
||||||
; Default value: yes
|
|
||||||
;decorate_workers_output = no
|
|
||||||
|
|
||||||
; Clear environment in FPM workers
|
|
||||||
; Prevents arbitrary environment variables from reaching FPM worker processes
|
|
||||||
; by clearing the environment in workers before env vars specified in this
|
|
||||||
; pool configuration are added.
|
|
||||||
; Setting to "no" will make all environment variables available to PHP code
|
|
||||||
; via getenv(), $_ENV and $_SERVER.
|
|
||||||
; Default Value: yes
|
|
||||||
;clear_env = no
|
|
||||||
|
|
||||||
; Limits the extensions of the main script FPM will allow to parse. This can
|
|
||||||
; prevent configuration mistakes on the web server side. You should only limit
|
|
||||||
; FPM to .php extensions to prevent malicious users to use other extensions to
|
|
||||||
; execute php code.
|
|
||||||
; Note: set an empty value to allow all extensions.
|
|
||||||
; Default Value: .php
|
|
||||||
;security.limit_extensions = .php .php3 .php4 .php5 .php7
|
|
||||||
|
|
||||||
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
|
|
||||||
; the current environment.
|
|
||||||
; Default Value: clean env
|
|
||||||
;env[HOSTNAME] = $HOSTNAME
|
|
||||||
;env[PATH] = /usr/local/bin:/usr/bin:/bin
|
|
||||||
;env[TMP] = /tmp
|
|
||||||
;env[TMPDIR] = /tmp
|
|
||||||
;env[TEMP] = /tmp
|
|
||||||
|
|
||||||
; Additional php.ini defines, specific to this pool of workers. These settings
|
|
||||||
; overwrite the values previously defined in the php.ini. The directives are the
|
|
||||||
; same as the PHP SAPI:
|
|
||||||
; php_value/php_flag - you can set classic ini defines which can
|
|
||||||
; be overwritten from PHP call 'ini_set'.
|
|
||||||
; php_admin_value/php_admin_flag - these directives won't be overwritten by
|
|
||||||
; PHP call 'ini_set'
|
|
||||||
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
|
|
||||||
|
|
||||||
; Defining 'extension' will load the corresponding shared extension from
|
|
||||||
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
|
|
||||||
; overwrite previously defined php.ini values, but will append the new value
|
|
||||||
; instead.
|
|
||||||
|
|
||||||
; Note: path INI options can be relative and will be expanded with the prefix
|
|
||||||
; (pool, global or /usr)
|
|
||||||
|
|
||||||
; Default Value: nothing is defined by default except the values in php.ini and
|
|
||||||
; specified at startup with the -d argument
|
|
||||||
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
|
|
||||||
;php_flag[display_errors] = off
|
|
||||||
;php_admin_value[error_log] = /var/log/fpm-php.www.log
|
|
||||||
;php_admin_flag[log_errors] = on
|
|
||||||
;php_admin_value[memory_limit] = 32M
|
|
||||||
1
wordpress_docker
Submodule
1
wordpress_docker
Submodule
Submodule wordpress_docker added at 91ebf533c3
Reference in New Issue
Block a user