Skip to content

Commit

Permalink
Introduced new HTTP_INDEX_FILE variable to control index page
Browse files Browse the repository at this point in the history
  • Loading branch information
dotneft committed Jan 20, 2024
1 parent 4c1b88b commit cd3464b
Show file tree
Hide file tree
Showing 56 changed files with 238 additions and 70 deletions.
4 changes: 4 additions & 0 deletions Dockerfiles/web-apache-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ Use IEEE754 compatible value range for 64-bit Numeric (float) history values. Av

The variable sets the Access Log directive for Web-server. By default, value corresponds to standard output.

### `HTTP_INDEX_FILE`

The variable controls default index page. By default, `index.php`.

### `ZBX_MAXEXECUTIONTIME`

The varable is PHP ``max_execution_time`` option. By default, value is `300`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VirtualHost *:8080>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Listen 8443
<VirtualHost *:8443>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}

AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps
Expand Down
11 changes: 11 additions & 0 deletions Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,17 @@ prepare_zbx_web_config() {
rm -f "/tmp/defines.inc.php_tmp"
fi

: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf"

if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conff"
fi

: ${ENABLE_WEB_ACCESS_LOG:="true"}

if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VirtualHost *:8080>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Listen 8443
<VirtualHost *:8443>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}

AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps
Expand Down
11 changes: 11 additions & 0 deletions Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@ prepare_zbx_web_config() {
rm -f "/tmp/defines.inc.php_tmp"
fi

: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf"

if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conff"
fi

: ${ENABLE_WEB_ACCESS_LOG:="true"}

if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VirtualHost *:8080>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Listen 8443
<VirtualHost *:8443>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}

AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps
Expand Down
11 changes: 11 additions & 0 deletions Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@ prepare_zbx_web_config() {
rm -f "/tmp/defines.inc.php_tmp"
fi

: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf"

if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conff"
fi

: ${ENABLE_WEB_ACCESS_LOG:="true"}

if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VirtualHost *:8080>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
<VirtualHost *:8443>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}

AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps
Expand Down
11 changes: 11 additions & 0 deletions Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,17 @@ prepare_zbx_web_config() {
rm -f "/tmp/defines.inc.php_tmp"
fi

: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf"

if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conff"
fi

: ${ENABLE_WEB_ACCESS_LOG:="true"}

if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/web-apache-pgsql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ Use IEEE754 compatible value range for 64-bit Numeric (float) history values. Av

The variable sets the Access Log directive for Web-server. By default, value corresponds to standard output.

### `HTTP_INDEX_FILE`

The variable controls default index page. By default, `index.php`.

### `ZBX_MAXEXECUTIONTIME`

The varable is PHP ``max_execution_time`` option. By default, value is `300`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VirtualHost *:8080>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Listen 8443
<VirtualHost *:8443>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}

AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps
Expand Down
11 changes: 11 additions & 0 deletions Dockerfiles/web-apache-pgsql/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,17 @@ prepare_zbx_web_config() {
rm -f "/tmp/defines.inc.php_tmp"
fi

: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf"

if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conff"
fi

: ${ENABLE_WEB_ACCESS_LOG:="true"}

if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VirtualHost *:8080>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Listen 8443
<VirtualHost *:8443>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}

AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps
Expand Down
11 changes: 11 additions & 0 deletions Dockerfiles/web-apache-pgsql/centos/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,17 @@ prepare_zbx_web_config() {
rm -f "/tmp/defines.inc.php_tmp"
fi

: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf"

if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conff"
fi

: ${ENABLE_WEB_ACCESS_LOG:="true"}

if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VirtualHost *:8080>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Listen 8443
<VirtualHost *:8443>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}

AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps
Expand Down
11 changes: 11 additions & 0 deletions Dockerfiles/web-apache-pgsql/ol/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,17 @@ prepare_zbx_web_config() {
rm -f "/tmp/defines.inc.php_tmp"
fi

: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf"

if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conff"
fi

: ${ENABLE_WEB_ACCESS_LOG:="true"}

if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VirtualHost *:8080>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
<VirtualHost *:8443>
DocumentRoot /usr/share/zabbix/
ServerName zabbix
DirectoryIndex index.php
DirectoryIndex {HTTP_INDEX_FILE}

AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps
Expand Down
11 changes: 11 additions & 0 deletions Dockerfiles/web-apache-pgsql/ubuntu/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,17 @@ prepare_zbx_web_config() {
rm -f "/tmp/defines.inc.php_tmp"
fi

: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf"

if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conff"
fi

: ${ENABLE_WEB_ACCESS_LOG:="true"}

if [ "${ENABLE_WEB_ACCESS_LOG,,}" == "false" ]; then
Expand Down
4 changes: 4 additions & 0 deletions Dockerfiles/web-nginx-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ Use IEEE754 compatible value range for 64-bit Numeric (float) history values. Av

The variable sets the Access Log directive for Web-server. By default, value corresponds to standard output.

### `HTTP_INDEX_FILE`

The variable controls default index page. By default, `index.php`.

### `ZBX_MAXEXECUTIONTIME`

The varable is PHP ``max_execution_time`` option. By default, value is `300`.
Expand Down
5 changes: 2 additions & 3 deletions Dockerfiles/web-nginx-mysql/alpine/conf/etc/zabbix/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ server {
listen [::]:8080;

server_name zabbix;
index index.php;
index {HTTP_INDEX_FILE};

access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log notice;
Expand Down Expand Up @@ -51,7 +51,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;

fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}

Expand All @@ -65,7 +64,7 @@ server {
try_files $fastcgi_script_name =404;

fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};

fastcgi_param DOCUMENT_ROOT $webroot;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ server {
server_name zabbix;
server_name_in_redirect off;

index index.php;
index {HTTP_INDEX_FILE};
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log error;

Expand Down Expand Up @@ -70,7 +70,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;

fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}

Expand All @@ -84,7 +83,7 @@ server {
try_files $fastcgi_script_name =404;

fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};

fastcgi_param DOCUMENT_ROOT $webroot;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
Expand Down
9 changes: 9 additions & 0 deletions Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,19 @@ prepare_zbx_web_config() {
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf"

: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf"

if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then
sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf"

sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf"
fi

: ${ENABLE_WEB_ACCESS_LOG:="true"}
Expand Down
Loading

0 comments on commit cd3464b

Please sign in to comment.