From 00b193ea1ee367fbcba79a5b6e09609a91bd6b7e Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Tue, 23 Jun 2020 17:01:42 +0300 Subject: [PATCH 1/2] MySQL -> PostgreSQL in web images --- web-apache-pgsql/alpine/docker-entrypoint.sh | 2 +- web-apache-pgsql/centos/docker-entrypoint.sh | 2 +- web-apache-pgsql/ubuntu/docker-entrypoint.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web-apache-pgsql/alpine/docker-entrypoint.sh b/web-apache-pgsql/alpine/docker-entrypoint.sh index f623a1d99..20f0e31ad 100755 --- a/web-apache-pgsql/alpine/docker-entrypoint.sh +++ b/web-apache-pgsql/alpine/docker-entrypoint.sh @@ -236,7 +236,7 @@ prepare_zbx_web_config() { ################################################# -echo "** Deploying Zabbix web-interface (Apache) with MySQL database" +echo "** Deploying Zabbix web-interface (Apache) with PostgreSQL database" check_variables check_db_connect diff --git a/web-apache-pgsql/centos/docker-entrypoint.sh b/web-apache-pgsql/centos/docker-entrypoint.sh index f7a450dbf..ceb4bedb3 100755 --- a/web-apache-pgsql/centos/docker-entrypoint.sh +++ b/web-apache-pgsql/centos/docker-entrypoint.sh @@ -237,7 +237,7 @@ prepare_zbx_web_config() { ################################################# -echo "** Deploying Zabbix web-interface (Apache) with MySQL database" +echo "** Deploying Zabbix web-interface (Apache) with PostgreSQL database" check_variables check_db_connect diff --git a/web-apache-pgsql/ubuntu/docker-entrypoint.sh b/web-apache-pgsql/ubuntu/docker-entrypoint.sh index 0c4fa84aa..9ed7fab42 100755 --- a/web-apache-pgsql/ubuntu/docker-entrypoint.sh +++ b/web-apache-pgsql/ubuntu/docker-entrypoint.sh @@ -237,7 +237,7 @@ prepare_zbx_web_config() { ################################################# -echo "** Deploying Zabbix web-interface (Apache) with MySQL database" +echo "** Deploying Zabbix web-interface (Apache) with PostgreSQL database" check_variables check_db_connect From 97bd86332307aaddfc7d6e4488552595dbb98d1a Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Sun, 28 Jun 2020 18:54:33 +0300 Subject: [PATCH 2/2] Added posibility to disable Access log for web-interface containers --- .env_web | 1 + web-apache-mysql/alpine/docker-entrypoint.sh | 6 ++++++ web-apache-mysql/centos/docker-entrypoint.sh | 6 ++++++ web-apache-mysql/ubuntu/docker-entrypoint.sh | 9 +++++++++ web-apache-pgsql/alpine/docker-entrypoint.sh | 6 ++++++ web-apache-pgsql/centos/docker-entrypoint.sh | 6 ++++++ web-apache-pgsql/ubuntu/docker-entrypoint.sh | 9 +++++++++ web-nginx-mysql/alpine/docker-entrypoint.sh | 12 ++++++++++++ web-nginx-mysql/centos/docker-entrypoint.sh | 12 ++++++++++++ web-nginx-mysql/ubuntu/docker-entrypoint.sh | 12 ++++++++++++ web-nginx-pgsql/alpine/docker-entrypoint.sh | 12 ++++++++++++ web-nginx-pgsql/centos/docker-entrypoint.sh | 12 ++++++++++++ web-nginx-pgsql/ubuntu/docker-entrypoint.sh | 12 ++++++++++++ 13 files changed, 115 insertions(+) diff --git a/.env_web b/.env_web index 0b15d6d85..e19969155 100644 --- a/.env_web +++ b/.env_web @@ -1,6 +1,7 @@ # ZBX_SERVER_HOST=zabbix-server # ZBX_SERVER_PORT=10051 ZBX_SERVER_NAME=Composed installation +# ENABLE_WEB_ACCESS_LOG=true # ZBX_MAXEXECUTIONTIME=600 # ZBX_MEMORYLIMIT=128M # ZBX_POSTMAXSIZE=16M diff --git a/web-apache-mysql/alpine/docker-entrypoint.sh b/web-apache-mysql/alpine/docker-entrypoint.sh index f66764f3d..f10c16b9e 100755 --- a/web-apache-mysql/alpine/docker-entrypoint.sh +++ b/web-apache-mysql/alpine/docker-entrypoint.sh @@ -231,6 +231,12 @@ prepare_zbx_web_config() { -e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \ -e "s/{ZBX_SERVER_NAME}/$server_name/g" \ "$ZBX_WEB_CONFIG" + + if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + sed -ri \ + -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ + "/etc/apache2/httpd.conf" + fi } ################################################# diff --git a/web-apache-mysql/centos/docker-entrypoint.sh b/web-apache-mysql/centos/docker-entrypoint.sh index 8b955c1cf..1e556658b 100755 --- a/web-apache-mysql/centos/docker-entrypoint.sh +++ b/web-apache-mysql/centos/docker-entrypoint.sh @@ -231,6 +231,12 @@ prepare_zbx_web_config() { -e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \ -e "s/{ZBX_SERVER_NAME}/$server_name/g" \ "$ZBX_WEB_CONFIG" + + if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + sed -ri \ + -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ + "/etc/httpd/conf/httpd.conf" + fi } ################################################# diff --git a/web-apache-mysql/ubuntu/docker-entrypoint.sh b/web-apache-mysql/ubuntu/docker-entrypoint.sh index f05a37dec..3cd52ce60 100755 --- a/web-apache-mysql/ubuntu/docker-entrypoint.sh +++ b/web-apache-mysql/ubuntu/docker-entrypoint.sh @@ -231,6 +231,15 @@ prepare_zbx_web_config() { -e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \ -e "s/{ZBX_SERVER_NAME}/$server_name/g" \ "$ZBX_WEB_CONFIG" + + if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + sed -ri \ + -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ + "/etc/apache2/apache2.conf" + sed -ri \ + -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ + "/etc/apache2/conf-available/other-vhosts-access-log.conf" + fi } ################################################# diff --git a/web-apache-pgsql/alpine/docker-entrypoint.sh b/web-apache-pgsql/alpine/docker-entrypoint.sh index 20f0e31ad..931d85d5e 100755 --- a/web-apache-pgsql/alpine/docker-entrypoint.sh +++ b/web-apache-pgsql/alpine/docker-entrypoint.sh @@ -232,6 +232,12 @@ prepare_zbx_web_config() { -e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \ -e "s/{ZBX_SERVER_NAME}/$server_name/g" \ "$ZBX_WEB_CONFIG" + + if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + sed -ri \ + -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ + "/etc/apache2/httpd.conf" + fi } ################################################# diff --git a/web-apache-pgsql/centos/docker-entrypoint.sh b/web-apache-pgsql/centos/docker-entrypoint.sh index ceb4bedb3..3257306c0 100755 --- a/web-apache-pgsql/centos/docker-entrypoint.sh +++ b/web-apache-pgsql/centos/docker-entrypoint.sh @@ -233,6 +233,12 @@ prepare_zbx_web_config() { -e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \ -e "s/{ZBX_SERVER_NAME}/$server_name/g" \ "$ZBX_WEB_CONFIG" + + if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + sed -ri \ + -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ + "/etc/httpd/conf/httpd.conf" + fi } ################################################# diff --git a/web-apache-pgsql/ubuntu/docker-entrypoint.sh b/web-apache-pgsql/ubuntu/docker-entrypoint.sh index 9ed7fab42..81ca0c4e9 100755 --- a/web-apache-pgsql/ubuntu/docker-entrypoint.sh +++ b/web-apache-pgsql/ubuntu/docker-entrypoint.sh @@ -233,6 +233,15 @@ prepare_zbx_web_config() { -e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \ -e "s/{ZBX_SERVER_NAME}/$server_name/g" \ "$ZBX_WEB_CONFIG" + + if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + sed -ri \ + -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ + "/etc/apache2/apache2.conf" + sed -ri \ + -e 's!^(\s*CustomLog)\s+\S+!\1 /dev/null!g' \ + "/etc/apache2/conf-available/other-vhosts-access-log.conf" + fi } ################################################# diff --git a/web-nginx-mysql/alpine/docker-entrypoint.sh b/web-nginx-mysql/alpine/docker-entrypoint.sh index c0b160528..d9e7650df 100755 --- a/web-nginx-mysql/alpine/docker-entrypoint.sh +++ b/web-nginx-mysql/alpine/docker-entrypoint.sh @@ -259,6 +259,18 @@ prepare_zbx_web_config() { -e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \ -e "s/{ZBX_SERVER_NAME}/$server_name/g" \ "$ZBX_WEB_CONFIG" + + if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/nginx/nginx.conf" + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/zabbix/nginx.conf" + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/zabbix/nginx_ssl.conf" + fi } ################################################# diff --git a/web-nginx-mysql/centos/docker-entrypoint.sh b/web-nginx-mysql/centos/docker-entrypoint.sh index bf6e88ad2..c022ef887 100755 --- a/web-nginx-mysql/centos/docker-entrypoint.sh +++ b/web-nginx-mysql/centos/docker-entrypoint.sh @@ -259,6 +259,18 @@ prepare_zbx_web_config() { -e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \ -e "s/{ZBX_SERVER_NAME}/$server_name/g" \ "$ZBX_WEB_CONFIG" + + if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/nginx/nginx.conf" + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/zabbix/nginx.conf" + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/zabbix/nginx_ssl.conf" + fi } ################################################# diff --git a/web-nginx-mysql/ubuntu/docker-entrypoint.sh b/web-nginx-mysql/ubuntu/docker-entrypoint.sh index 962a383cc..c99c9eda7 100755 --- a/web-nginx-mysql/ubuntu/docker-entrypoint.sh +++ b/web-nginx-mysql/ubuntu/docker-entrypoint.sh @@ -259,6 +259,18 @@ prepare_zbx_web_config() { -e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \ -e "s/{ZBX_SERVER_NAME}/$server_name/g" \ "$ZBX_WEB_CONFIG" + + if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/nginx/nginx.conf" + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/zabbix/nginx.conf" + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/zabbix/nginx_ssl.conf" + fi } ################################################# diff --git a/web-nginx-pgsql/alpine/docker-entrypoint.sh b/web-nginx-pgsql/alpine/docker-entrypoint.sh index 8d3485646..9cfe65d22 100755 --- a/web-nginx-pgsql/alpine/docker-entrypoint.sh +++ b/web-nginx-pgsql/alpine/docker-entrypoint.sh @@ -259,6 +259,18 @@ prepare_zbx_web_config() { -e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \ -e "s/{ZBX_SERVER_NAME}/$server_name/g" \ "$ZBX_WEB_CONFIG" + + if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/nginx/nginx.conf" + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/zabbix/nginx.conf" + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/zabbix/nginx_ssl.conf" + fi } ################################################# diff --git a/web-nginx-pgsql/centos/docker-entrypoint.sh b/web-nginx-pgsql/centos/docker-entrypoint.sh index 825689bec..88b4e850d 100755 --- a/web-nginx-pgsql/centos/docker-entrypoint.sh +++ b/web-nginx-pgsql/centos/docker-entrypoint.sh @@ -259,6 +259,18 @@ prepare_zbx_web_config() { -e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \ -e "s/{ZBX_SERVER_NAME}/$server_name/g" \ "$ZBX_WEB_CONFIG" + + if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/nginx/nginx.conf" + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/zabbix/nginx.conf" + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/zabbix/nginx_ssl.conf" + fi } ################################################# diff --git a/web-nginx-pgsql/ubuntu/docker-entrypoint.sh b/web-nginx-pgsql/ubuntu/docker-entrypoint.sh index 821b536f1..6a2e893d0 100755 --- a/web-nginx-pgsql/ubuntu/docker-entrypoint.sh +++ b/web-nginx-pgsql/ubuntu/docker-entrypoint.sh @@ -259,6 +259,18 @@ prepare_zbx_web_config() { -e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \ -e "s/{ZBX_SERVER_NAME}/$server_name/g" \ "$ZBX_WEB_CONFIG" + + if [ "${ENABLE_WEB_ACCESS_LOG:-"true"}" == "false" ]; then + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/nginx/nginx.conf" + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/zabbix/nginx.conf" + sed -ri \ + -e 's!^(\s*access_log).+\;!\1 off\;!g' \ + "/etc/zabbix/nginx_ssl.conf" + fi } #################################################