Introduced new HTTP_INDEX_FILE variable to control index page

This commit is contained in:
Alexey Pustovalov
2024-01-20 20:40:13 +09:00
parent 4c1b88b379
commit cd3464b511
56 changed files with 238 additions and 70 deletions

View File

@ -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

View File

@ -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

View File

@ -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