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 25972ed7a..6561b50cc 100755 --- a/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh @@ -18,6 +18,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" @@ -173,10 +176,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 5912feb4f..57e3abe56 100755 --- a/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh @@ -18,6 +18,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" @@ -173,10 +176,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 5912feb4f..57e3abe56 100755 --- a/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh @@ -18,6 +18,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" @@ -173,10 +176,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 8e471b6be..2be0bf1cc 100755 --- a/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh @@ -18,6 +18,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" @@ -173,10 +176,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 d30da6262..a45c81f6b 100755 --- a/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh @@ -18,6 +18,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" @@ -173,10 +176,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 5754a7641..3068daaad 100755 --- a/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh @@ -18,6 +18,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" @@ -160,10 +163,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 49e64ccf3..245f2579f 100755 --- a/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh @@ -18,6 +18,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" @@ -160,10 +163,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 49e64ccf3..245f2579f 100755 --- a/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh @@ -18,6 +18,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" @@ -160,10 +163,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/rhel/conf/etc/nginx/nginx.conf b/Dockerfiles/web-nginx-pgsql/rhel/conf/etc/nginx/nginx.conf index 7c96929b0..b31be3142 100644 --- a/Dockerfiles/web-nginx-pgsql/rhel/conf/etc/nginx/nginx.conf +++ b/Dockerfiles/web-nginx-pgsql/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-pgsql/rhel/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/rhel/docker-entrypoint.sh index 49e64ccf3..245f2579f 100755 --- a/Dockerfiles/web-nginx-pgsql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/rhel/docker-entrypoint.sh @@ -18,6 +18,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" @@ -160,10 +163,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 429e6576e..0b6f4d92f 100755 --- a/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh @@ -18,6 +18,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" @@ -160,10 +163,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"}