diff --git a/Dockerfiles/web-nginx-mysql/alpine/conf/etc/nginx/nginx.conf b/Dockerfiles/web-nginx-mysql/alpine/conf/etc/nginx/nginx.conf index f40a71604..00c238d74 100644 --- a/Dockerfiles/web-nginx-mysql/alpine/conf/etc/nginx/nginx.conf +++ b/Dockerfiles/web-nginx-mysql/alpine/conf/etc/nginx/nginx.conf @@ -1,4 +1,4 @@ -#user nginx; +# user nginx; worker_processes 5; worker_rlimit_nofile 256000; diff --git a/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh index 5807f5d9f..6527b0a9b 100755 --- a/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh @@ -20,6 +20,9 @@ fi # Default timezone for web interface : ${PHP_TZ:="Europe/Riga"} +# Default user +: ${DAEMON_USER:="nginx"} + # Default directories # Configuration files directory ZABBIX_ETC_DIR="/etc/zabbix" @@ -175,10 +178,12 @@ prepare_zbx_web_config() { export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"} if [ "$(id -u)" == '0' ]; then - echo "user = zabbix" >> "$PHP_CONFIG_FILE" - echo "group = zabbix" >> "$PHP_CONFIG_FILE" - echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE" - echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" + sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE" + + echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" fi : ${ZBX_DENY_GUI_ACCESS:="false"} diff --git a/Dockerfiles/web-nginx-mysql/centos/conf/etc/nginx/nginx.conf b/Dockerfiles/web-nginx-mysql/centos/conf/etc/nginx/nginx.conf index 7c96929b0..b31be3142 100644 --- a/Dockerfiles/web-nginx-mysql/centos/conf/etc/nginx/nginx.conf +++ b/Dockerfiles/web-nginx-mysql/centos/conf/etc/nginx/nginx.conf @@ -1,4 +1,4 @@ -#user nginx; +# user nginx; worker_processes 5; worker_rlimit_nofile 256000; diff --git a/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh index 45b8e325f..e4702456a 100755 --- a/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh @@ -20,6 +20,9 @@ fi # Default timezone for web interface : ${PHP_TZ:="Europe/Riga"} +# Default user +: ${DAEMON_USER:="nginx"} + # Default directories # Configuration files directory ZABBIX_ETC_DIR="/etc/zabbix" @@ -175,10 +178,12 @@ prepare_zbx_web_config() { export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"} if [ "$(id -u)" == '0' ]; then - echo "user = zabbix" >> "$PHP_CONFIG_FILE" - echo "group = zabbix" >> "$PHP_CONFIG_FILE" - echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE" - echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" + sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE" + + echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" fi : ${ZBX_DENY_GUI_ACCESS:="false"} diff --git a/Dockerfiles/web-nginx-mysql/ol/conf/etc/nginx/nginx.conf b/Dockerfiles/web-nginx-mysql/ol/conf/etc/nginx/nginx.conf index 7c96929b0..b31be3142 100644 --- a/Dockerfiles/web-nginx-mysql/ol/conf/etc/nginx/nginx.conf +++ b/Dockerfiles/web-nginx-mysql/ol/conf/etc/nginx/nginx.conf @@ -1,4 +1,4 @@ -#user nginx; +# user nginx; worker_processes 5; worker_rlimit_nofile 256000; diff --git a/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh index 45b8e325f..e4702456a 100755 --- a/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh @@ -20,6 +20,9 @@ fi # Default timezone for web interface : ${PHP_TZ:="Europe/Riga"} +# Default user +: ${DAEMON_USER:="nginx"} + # Default directories # Configuration files directory ZABBIX_ETC_DIR="/etc/zabbix" @@ -175,10 +178,12 @@ prepare_zbx_web_config() { export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"} if [ "$(id -u)" == '0' ]; then - echo "user = zabbix" >> "$PHP_CONFIG_FILE" - echo "group = zabbix" >> "$PHP_CONFIG_FILE" - echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE" - echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" + sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE" + + echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" fi : ${ZBX_DENY_GUI_ACCESS:="false"} diff --git a/Dockerfiles/web-nginx-mysql/rhel/conf/etc/nginx/nginx.conf b/Dockerfiles/web-nginx-mysql/rhel/conf/etc/nginx/nginx.conf index 7c96929b0..b31be3142 100644 --- a/Dockerfiles/web-nginx-mysql/rhel/conf/etc/nginx/nginx.conf +++ b/Dockerfiles/web-nginx-mysql/rhel/conf/etc/nginx/nginx.conf @@ -1,4 +1,4 @@ -#user nginx; +# user nginx; worker_processes 5; worker_rlimit_nofile 256000; diff --git a/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh index e2550bb3d..6f5c0146d 100755 --- a/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh @@ -20,6 +20,9 @@ fi # Default timezone for web interface : ${PHP_TZ:="Europe/Riga"} +# Default user +: ${DAEMON_USER:="nginx"} + # Default directories # Configuration files directory ZABBIX_ETC_DIR="/etc/zabbix" @@ -175,10 +178,12 @@ prepare_zbx_web_config() { export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"} if [ "$(id -u)" == '0' ]; then - echo "user = zabbix" >> "$PHP_CONFIG_FILE" - echo "group = zabbix" >> "$PHP_CONFIG_FILE" - echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE" - echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" + sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE" + + echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" fi : ${ZBX_DENY_GUI_ACCESS:="false"} diff --git a/Dockerfiles/web-nginx-mysql/ubuntu/conf/etc/nginx/nginx.conf b/Dockerfiles/web-nginx-mysql/ubuntu/conf/etc/nginx/nginx.conf index 7c96929b0..d6acf81e8 100644 --- a/Dockerfiles/web-nginx-mysql/ubuntu/conf/etc/nginx/nginx.conf +++ b/Dockerfiles/web-nginx-mysql/ubuntu/conf/etc/nginx/nginx.conf @@ -1,4 +1,4 @@ -#user nginx; +# user www-data; worker_processes 5; worker_rlimit_nofile 256000; diff --git a/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh index 31ada1678..85a85b7d3 100755 --- a/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh @@ -20,6 +20,9 @@ fi # Default timezone for web interface : ${PHP_TZ:="Europe/Riga"} +# Default user +: ${DAEMON_USER:="www-data"} + # Default directories # Configuration files directory ZABBIX_ETC_DIR="/etc/zabbix" @@ -175,10 +178,12 @@ prepare_zbx_web_config() { export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"} if [ "$(id -u)" == '0' ]; then - echo "user = zabbix" >> "$PHP_CONFIG_FILE" - echo "group = zabbix" >> "$PHP_CONFIG_FILE" - echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE" - echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" + sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE" + + echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" fi : ${ZBX_DENY_GUI_ACCESS:="false"} diff --git a/Dockerfiles/web-nginx-pgsql/alpine/conf/etc/nginx/nginx.conf b/Dockerfiles/web-nginx-pgsql/alpine/conf/etc/nginx/nginx.conf index f40a71604..00c238d74 100644 --- a/Dockerfiles/web-nginx-pgsql/alpine/conf/etc/nginx/nginx.conf +++ b/Dockerfiles/web-nginx-pgsql/alpine/conf/etc/nginx/nginx.conf @@ -1,4 +1,4 @@ -#user nginx; +# user nginx; worker_processes 5; worker_rlimit_nofile 256000; diff --git a/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh index 9f7cf1f6e..f2abac0ca 100755 --- a/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh @@ -20,6 +20,9 @@ fi # Default timezone for web interface : ${PHP_TZ:="Europe/Riga"} +# Default user +: ${DAEMON_USER:="nginx"} + # Default directories # Configuration files directory ZABBIX_ETC_DIR="/etc/zabbix" @@ -162,10 +165,12 @@ prepare_zbx_web_config() { export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"} if [ "$(id -u)" == '0' ]; then - echo "user = zabbix" >> "$PHP_CONFIG_FILE" - echo "group = zabbix" >> "$PHP_CONFIG_FILE" - echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE" - echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" + sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE" + + echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" fi : ${ZBX_DENY_GUI_ACCESS:="false"} diff --git a/Dockerfiles/web-nginx-pgsql/centos/conf/etc/nginx/nginx.conf b/Dockerfiles/web-nginx-pgsql/centos/conf/etc/nginx/nginx.conf index 7c96929b0..b31be3142 100644 --- a/Dockerfiles/web-nginx-pgsql/centos/conf/etc/nginx/nginx.conf +++ b/Dockerfiles/web-nginx-pgsql/centos/conf/etc/nginx/nginx.conf @@ -1,4 +1,4 @@ -#user nginx; +# user nginx; worker_processes 5; worker_rlimit_nofile 256000; diff --git a/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh index 8c2f0f147..2b2860537 100755 --- a/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh @@ -20,6 +20,9 @@ fi # Default timezone for web interface : ${PHP_TZ:="Europe/Riga"} +# Default user +: ${DAEMON_USER:="nginx"} + # Default directories # Configuration files directory ZABBIX_ETC_DIR="/etc/zabbix" @@ -162,10 +165,12 @@ prepare_zbx_web_config() { export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"} if [ "$(id -u)" == '0' ]; then - echo "user = zabbix" >> "$PHP_CONFIG_FILE" - echo "group = zabbix" >> "$PHP_CONFIG_FILE" - echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE" - echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" + sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE" + + echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" fi : ${ZBX_DENY_GUI_ACCESS:="false"} diff --git a/Dockerfiles/web-nginx-pgsql/ol/conf/etc/nginx/nginx.conf b/Dockerfiles/web-nginx-pgsql/ol/conf/etc/nginx/nginx.conf index 7c96929b0..b31be3142 100644 --- a/Dockerfiles/web-nginx-pgsql/ol/conf/etc/nginx/nginx.conf +++ b/Dockerfiles/web-nginx-pgsql/ol/conf/etc/nginx/nginx.conf @@ -1,4 +1,4 @@ -#user nginx; +# user nginx; worker_processes 5; worker_rlimit_nofile 256000; diff --git a/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh index 8c2f0f147..2b2860537 100755 --- a/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh @@ -20,6 +20,9 @@ fi # Default timezone for web interface : ${PHP_TZ:="Europe/Riga"} +# Default user +: ${DAEMON_USER:="nginx"} + # Default directories # Configuration files directory ZABBIX_ETC_DIR="/etc/zabbix" @@ -162,10 +165,12 @@ prepare_zbx_web_config() { export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"} if [ "$(id -u)" == '0' ]; then - echo "user = zabbix" >> "$PHP_CONFIG_FILE" - echo "group = zabbix" >> "$PHP_CONFIG_FILE" - echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE" - echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" + sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE" + + echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" fi : ${ZBX_DENY_GUI_ACCESS:="false"} diff --git a/Dockerfiles/web-nginx-pgsql/ubuntu/conf/etc/nginx/nginx.conf b/Dockerfiles/web-nginx-pgsql/ubuntu/conf/etc/nginx/nginx.conf index 7c96929b0..d6acf81e8 100644 --- a/Dockerfiles/web-nginx-pgsql/ubuntu/conf/etc/nginx/nginx.conf +++ b/Dockerfiles/web-nginx-pgsql/ubuntu/conf/etc/nginx/nginx.conf @@ -1,4 +1,4 @@ -#user nginx; +# user www-data; worker_processes 5; worker_rlimit_nofile 256000; diff --git a/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh index af44af056..794f0c6b8 100755 --- a/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh @@ -20,6 +20,9 @@ fi # Default timezone for web interface : ${PHP_TZ:="Europe/Riga"} +# Default user +: ${DAEMON_USER:="www-data"} + # Default directories # Configuration files directory ZABBIX_ETC_DIR="/etc/zabbix" @@ -162,10 +165,12 @@ prepare_zbx_web_config() { export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"} if [ "$(id -u)" == '0' ]; then - echo "user = zabbix" >> "$PHP_CONFIG_FILE" - echo "group = zabbix" >> "$PHP_CONFIG_FILE" - echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE" - echo "listen.group = nginx" >> "$PHP_CONFIG_FILE" + sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE" + + echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" + echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE" fi : ${ZBX_DENY_GUI_ACCESS:="false"}