diff --git a/.env_web b/.env_web index 959fcff33..43a0b202f 100644 --- a/.env_web +++ b/.env_web @@ -9,6 +9,7 @@ ZBX_SERVER_NAME=Composed installation # ZBX_DB_CIPHER_LIST= # Available since 5.0.0 # ZBX_HISTORYSTORAGEURL=http://elasticsearch:9200/ # Available since 3.4.5 # ZBX_HISTORYSTORAGETYPES=['uint', 'dbl', 'str', 'text', 'log'] # Available since 3.4.5 +# 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 f7499235e..04266e0b1 100755 --- a/web-apache-mysql/alpine/docker-entrypoint.sh +++ b/web-apache-mysql/alpine/docker-entrypoint.sh @@ -262,6 +262,12 @@ prepare_zbx_web_config() { sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_WWW_ROOT/include/defines.inc.php" rm -f "/tmp/defines.inc.php_tmp" fi + + 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 b817433e9..5e3a0ade8 100755 --- a/web-apache-mysql/centos/docker-entrypoint.sh +++ b/web-apache-mysql/centos/docker-entrypoint.sh @@ -262,6 +262,12 @@ prepare_zbx_web_config() { sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_WWW_ROOT/include/defines.inc.php" rm -f "/tmp/defines.inc.php_tmp" fi + + 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 f2a07403c..d00832998 100755 --- a/web-apache-mysql/ubuntu/docker-entrypoint.sh +++ b/web-apache-mysql/ubuntu/docker-entrypoint.sh @@ -255,6 +255,15 @@ prepare_zbx_web_config() { sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_WWW_ROOT/include/defines.inc.php" rm -f "/tmp/defines.inc.php_tmp" fi + + 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 efe64cf40..5e0fa94a7 100755 --- a/web-apache-pgsql/alpine/docker-entrypoint.sh +++ b/web-apache-pgsql/alpine/docker-entrypoint.sh @@ -261,11 +261,17 @@ prepare_zbx_web_config() { sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_WWW_ROOT/include/defines.inc.php" rm -f "/tmp/defines.inc.php_tmp" fi + + 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 } ################################################# -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 5cd77aeec..1c3b45bd5 100755 --- a/web-apache-pgsql/centos/docker-entrypoint.sh +++ b/web-apache-pgsql/centos/docker-entrypoint.sh @@ -264,11 +264,17 @@ prepare_zbx_web_config() { sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_WWW_ROOT/include/defines.inc.php" rm -f "/tmp/defines.inc.php_tmp" fi + + 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 } ################################################# -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 2e7490d5c..6d473b2ca 100755 --- a/web-apache-pgsql/ubuntu/docker-entrypoint.sh +++ b/web-apache-pgsql/ubuntu/docker-entrypoint.sh @@ -266,11 +266,20 @@ prepare_zbx_web_config() { sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_WWW_ROOT/include/defines.inc.php" rm -f "/tmp/defines.inc.php_tmp" fi + + 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 } ################################################# -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-nginx-mysql/alpine/docker-entrypoint.sh b/web-nginx-mysql/alpine/docker-entrypoint.sh index f8717440a..43b32ec79 100755 --- a/web-nginx-mysql/alpine/docker-entrypoint.sh +++ b/web-nginx-mysql/alpine/docker-entrypoint.sh @@ -290,6 +290,18 @@ prepare_zbx_web_config() { sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_WWW_ROOT/include/defines.inc.php" rm -f "/tmp/defines.inc.php_tmp" fi + + 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 6eb0ac402..c66ee27c2 100755 --- a/web-nginx-mysql/centos/docker-entrypoint.sh +++ b/web-nginx-mysql/centos/docker-entrypoint.sh @@ -290,6 +290,18 @@ prepare_zbx_web_config() { sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_WWW_ROOT/include/defines.inc.php" rm -f "/tmp/defines.inc.php_tmp" fi + + 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 39b9b902c..0cb199a93 100755 --- a/web-nginx-mysql/ubuntu/docker-entrypoint.sh +++ b/web-nginx-mysql/ubuntu/docker-entrypoint.sh @@ -282,6 +282,18 @@ prepare_zbx_web_config() { sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_WWW_ROOT/include/defines.inc.php" rm -f "/tmp/defines.inc.php_tmp" fi + + 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 4c159808c..3e438e608 100755 --- a/web-nginx-pgsql/alpine/docker-entrypoint.sh +++ b/web-nginx-pgsql/alpine/docker-entrypoint.sh @@ -291,6 +291,18 @@ prepare_zbx_web_config() { sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_WWW_ROOT/include/defines.inc.php" rm -f "/tmp/defines.inc.php_tmp" fi + + 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 5ffd5a008..0b297ed47 100755 --- a/web-nginx-pgsql/centos/docker-entrypoint.sh +++ b/web-nginx-pgsql/centos/docker-entrypoint.sh @@ -291,6 +291,18 @@ prepare_zbx_web_config() { sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_WWW_ROOT/include/defines.inc.php" rm -f "/tmp/defines.inc.php_tmp" fi + + 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 2d31a16cd..de47e9f3f 100755 --- a/web-nginx-pgsql/ubuntu/docker-entrypoint.sh +++ b/web-nginx-pgsql/ubuntu/docker-entrypoint.sh @@ -287,6 +287,18 @@ prepare_zbx_web_config() { sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_WWW_ROOT/include/defines.inc.php" rm -f "/tmp/defines.inc.php_tmp" fi + + 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 } #################################################