From b56da3adb6329fa97fb1348caad671005a768932 Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Wed, 10 Nov 2021 16:44:04 +0000 Subject: [PATCH] 2.4.51-debian-10-r32 release --- bitnami/apache/2.4/debian-10/Dockerfile | 2 +- .../opt/bitnami/scripts/libwebserver.sh | 4 +- .../app-generic-http-vhost.conf.tpl | 1 + .../app-generic-https-vhost.conf.tpl | 1 + .../bitnami-templates/app-http-vhost.conf.tpl | 1 + .../app-https-vhost.conf.tpl | 1 + .../app-proxy-http-vhost.conf.tpl | 1 + .../app-proxy-https-vhost.conf.tpl | 1 + .../app-ruby-passenger-http-vhost.conf.tpl | 1 + .../app-ruby-passenger-https-vhost.conf.tpl | 1 + .../rootfs/opt/bitnami/scripts/libapache.sh | 44 ++++++++++++------- bitnami/apache/README.md | 2 +- 12 files changed, 40 insertions(+), 20 deletions(-) diff --git a/bitnami/apache/2.4/debian-10/Dockerfile b/bitnami/apache/2.4/debian-10/Dockerfile index 9079547db49d..aa2bcde0cb6d 100644 --- a/bitnami/apache/2.4/debian-10/Dockerfile +++ b/bitnami/apache/2.4/debian-10/Dockerfile @@ -20,7 +20,7 @@ ENV APACHE_ENABLE_CUSTOM_PORTS="no" \ APACHE_HTTPS_PORT_NUMBER="" \ APACHE_HTTP_PORT_NUMBER="" \ BITNAMI_APP_NAME="apache" \ - BITNAMI_IMAGE_VERSION="2.4.51-debian-10-r31" \ + BITNAMI_IMAGE_VERSION="2.4.51-debian-10-r32" \ PATH="/opt/bitnami/common/bin:/opt/bitnami/apache/bin:$PATH" EXPOSE 8080 8443 diff --git a/bitnami/apache/2.4/debian-10/prebuildfs/opt/bitnami/scripts/libwebserver.sh b/bitnami/apache/2.4/debian-10/prebuildfs/opt/bitnami/scripts/libwebserver.sh index 785d883f325e..459f99c7d1cd 100644 --- a/bitnami/apache/2.4/debian-10/prebuildfs/opt/bitnami/scripts/libwebserver.sh +++ b/bitnami/apache/2.4/debian-10/prebuildfs/opt/bitnami/scripts/libwebserver.sh @@ -178,13 +178,13 @@ web_server_reload() { # Apache-specific flags: # --apache-additional-configuration - Additional vhost configuration (no default) # --apache-before-vhost-configuration - Configuration to add before the directive (no default) -# --apache-allow-override - Whether to allow .htaccess files (only allowed when --move-htaccess is set to 'no') +# --apache-allow-override - Whether to allow .htaccess files (only allowed when --move-htaccess is set to 'no' and type is not defined) # --apache-extra-directory-configuration - Extra configuration for the document root directory # --apache-proxy-address - Address where to proxy requests # --apache-proxy-configuration - Extra configuration for the proxy # --apache-proxy-http-configuration - Extra configuration for the proxy HTTP vhost # --apache-proxy-https-configuration - Extra configuration for the proxy HTTPS vhost -# --apache-move-htaccess - Move .htaccess files to a common place so they can be loaded during Apache startup +# --apache-move-htaccess - Move .htaccess files to a common place so they can be loaded during Apache startup (only allowed when type is not defined) # NGINX-specific flags: # --nginx-additional-configuration - Additional server block configuration (no default) # --nginx-external-configuration - Configuration external to server block (no default) diff --git a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-generic-http-vhost.conf.tpl b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-generic-http-vhost.conf.tpl index 9c0eadc5b6ed..eacc2462307f 100644 --- a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-generic-http-vhost.conf.tpl +++ b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-generic-http-vhost.conf.tpl @@ -1,3 +1,4 @@ +{{http_listen_configuration}} {{before_vhost_configuration}} {{server_name_configuration}} diff --git a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-generic-https-vhost.conf.tpl b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-generic-https-vhost.conf.tpl index bf601e084738..0cbe5e47ca37 100644 --- a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-generic-https-vhost.conf.tpl +++ b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-generic-https-vhost.conf.tpl @@ -1,3 +1,4 @@ +{{https_listen_configuration}} {{before_vhost_configuration}} {{server_name_configuration}} diff --git a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-http-vhost.conf.tpl b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-http-vhost.conf.tpl index ee67cd0d9c26..56780c5d258b 100644 --- a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-http-vhost.conf.tpl +++ b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-http-vhost.conf.tpl @@ -1,3 +1,4 @@ +{{http_listen_configuration}} {{before_vhost_configuration}} {{server_name_configuration}} diff --git a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-https-vhost.conf.tpl b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-https-vhost.conf.tpl index eb1e0e3d6485..2fcc78c01951 100644 --- a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-https-vhost.conf.tpl +++ b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-https-vhost.conf.tpl @@ -1,3 +1,4 @@ +{{https_listen_configuration}} {{before_vhost_configuration}} {{server_name_configuration}} diff --git a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-proxy-http-vhost.conf.tpl b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-proxy-http-vhost.conf.tpl index 939b06c897f4..854b321ad6ec 100644 --- a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-proxy-http-vhost.conf.tpl +++ b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-proxy-http-vhost.conf.tpl @@ -1,3 +1,4 @@ +{{http_listen_configuration}} {{before_vhost_configuration}} {{server_name_configuration}} diff --git a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-proxy-https-vhost.conf.tpl b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-proxy-https-vhost.conf.tpl index 9b555e8acf8b..d8a5352263a6 100644 --- a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-proxy-https-vhost.conf.tpl +++ b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-proxy-https-vhost.conf.tpl @@ -1,3 +1,4 @@ +{{https_listen_configuration}} {{before_vhost_configuration}} {{server_name_configuration}} diff --git a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-ruby-passenger-http-vhost.conf.tpl b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-ruby-passenger-http-vhost.conf.tpl index 51be5b20f59b..44be06d12aad 100644 --- a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-ruby-passenger-http-vhost.conf.tpl +++ b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-ruby-passenger-http-vhost.conf.tpl @@ -1,3 +1,4 @@ +{{http_listen_configuration}} {{before_vhost_configuration}} PassengerPreStart http://localhost:{{http_port}}/ diff --git a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-ruby-passenger-https-vhost.conf.tpl b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-ruby-passenger-https-vhost.conf.tpl index 965290090fb2..fdc65c37cee9 100644 --- a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-ruby-passenger-https-vhost.conf.tpl +++ b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/apache/bitnami-templates/app-ruby-passenger-https-vhost.conf.tpl @@ -1,3 +1,4 @@ +{{https_listen_configuration}} {{before_vhost_configuration}} PassengerPreStart https://localhost:{{https_port}}/ diff --git a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/libapache.sh b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/libapache.sh index a5bc9708b60c..99c18af35cd6 100644 --- a/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/libapache.sh +++ b/bitnami/apache/2.4/debian-10/rootfs/opt/bitnami/scripts/libapache.sh @@ -327,10 +327,10 @@ EOF # --disable-https - Whether to render the app's HTTPS virtual host with a .disabled prefix # --http-port - HTTP port number # --https-port - HTTPS port number -# --move-htaccess - Move .htaccess files to a common place so they can be loaded during Apache startup +# --move-htaccess - Move .htaccess files to a common place so they can be loaded during Apache startup (only allowed when type is not defined) # --additional-configuration - Additional vhost configuration (no default) # --before-vhost-configuration - Configuration to add before the directive (no default) -# --allow-override - Whether to allow .htaccess files (only allowed when --move-htaccess is set to 'no') +# --allow-override - Whether to allow .htaccess files (only allowed when --move-htaccess is set to 'no' and type is not defined) # --document-root - Path to document root directory # --extra-directory-configuration - Extra configuration for the document root directory # --proxy-address - Address where to proxy requests @@ -358,8 +358,10 @@ ensure_apache_app_configuration_exists() { export allow_override="All" export document_root="${BITNAMI_ROOT_DIR}/${app}" export extra_directory_configuration="" - export http_port="${APACHE_HTTP_PORT_NUMBER:-"$APACHE_DEFAULT_HTTP_PORT_NUMBER"}" - export https_port="${APACHE_HTTPS_PORT_NUMBER:-"$APACHE_DEFAULT_HTTPS_PORT_NUMBER"}" + export default_http_port="${APACHE_HTTP_PORT_NUMBER:-"$APACHE_DEFAULT_HTTP_PORT_NUMBER"}" + export default_https_port="${APACHE_HTTPS_PORT_NUMBER:-"$APACHE_DEFAULT_HTTPS_PORT_NUMBER"}" + export http_port="$default_http_port" + export https_port="$default_https_port" export proxy_address="" export proxy_configuration="" export proxy_http_configuration="" @@ -409,6 +411,11 @@ ensure_apache_app_configuration_exists() { esac shift done + # Construct listen ports configuration (only to add when using non-standard ports) + export http_listen_configuration="" + export https_listen_configuration="" + [[ "$http_port" != "$default_http_port" ]] && http_listen_configuration="Listen ${http_port}" + [[ "$https_port" != "$default_https_port" ]] && https_listen_configuration="Listen ${https_port}" # Construct host string in the format of "host1:port1[ host2:port2[ ...]]" export http_listen_addresses="" export https_listen_addresses="" @@ -426,10 +433,10 @@ ensure_apache_app_configuration_exists() { if [[ "${#server_aliases[@]}" -gt 0 ]]; then server_name_configuration+=$'\n'"ServerAlias ${server_aliases[*]}" fi - # App .htaccess support + # App .htaccess support (only when type is not defined) export htaccess_include - is_boolean_yes "$move_htaccess" && apache_replace_htaccess_files "$app" --document-root "$document_root" - if [[ -f "${APACHE_HTACCESS_DIR}/${app}-htaccess.conf" ]]; then + [[ -z "$type" ]] && is_boolean_yes "$move_htaccess" && apache_replace_htaccess_files "$app" --document-root "$document_root" + if [[ -z "$type" && -f "${APACHE_HTACCESS_DIR}/${app}-htaccess.conf" ]]; then allow_override="None" htaccess_include="Include \"${APACHE_HTACCESS_DIR}/${app}-htaccess.conf\"" else @@ -455,6 +462,7 @@ EOF server_name_configuration="$(indent $'\n'"$server_name_configuration" 2)" additional_configuration="$(indent $'\n'"$additional_configuration" 2)" htaccess_include="$(indent $'\n'"$htaccess_include" 2)" + acl_configuration=""$(indent $'\n'"$acl_configuration" 4) extra_directory_configuration="$(indent $'\n'"$extra_directory_configuration" 4)" proxy_configuration="$(indent $'\n'"$proxy_configuration" 2)" proxy_http_configuration="$(indent $'\n'"$proxy_http_configuration" 2)" @@ -519,10 +527,10 @@ ensure_apache_app_configuration_not_exists() { # Flags: # --type - Application type, which has an effect on what configuration template will be used, allowed values: php, (empty) # --allow-remote-connections - Whether to allow remote connections or to require local connections -# --move-htaccess - Move .htaccess files to a common place so they can be loaded during Apache startup +# --move-htaccess - Move .htaccess files to a common place so they can be loaded during Apache startup (only allowed when type is not defined) # --prefix - URL prefix from where it will be accessible (i.e. /myapp) # --additional-configuration - Additional vhost configuration (no default) -# --allow-override - Whether to allow .htaccess files (only allowed when --move-htaccess is set to 'no') +# --allow-override - Whether to allow .htaccess files (only allowed when --move-htaccess is set to 'no' and type is not defined) # --document-root - Path to document root directory # --extra-directory-configuration - Extra configuration for the document root directory # Returns: @@ -565,10 +573,10 @@ ensure_apache_prefix_configuration_exists() { esac shift done - # App .htaccess support + # App .htaccess support (only when type is not defined) export htaccess_include - is_boolean_yes "$move_htaccess" && apache_replace_htaccess_files "$app" --document-root "$document_root" - if [[ -f "${APACHE_HTACCESS_DIR}/${app}-htaccess.conf" ]]; then + [[ -z "$type" ]] && is_boolean_yes "$move_htaccess" && apache_replace_htaccess_files "$app" --document-root "$document_root" + if [[ -z "$type" && -f "${APACHE_HTACCESS_DIR}/${app}-htaccess.conf" ]]; then allow_override="None" htaccess_include="Include \"${APACHE_HTACCESS_DIR}/${app}-htaccess.conf\"" else @@ -643,8 +651,10 @@ apache_update_app_configuration() { local enable_https="no" local disable_http="no" local disable_https="no" - local http_port="${APACHE_HTTP_PORT_NUMBER:-"$APACHE_DEFAULT_HTTP_PORT_NUMBER"}" - local https_port="${APACHE_HTTPS_PORT_NUMBER:-"$APACHE_DEFAULT_HTTPS_PORT_NUMBER"}" + export default_http_port="${APACHE_HTTP_PORT_NUMBER:-"$APACHE_DEFAULT_HTTP_PORT_NUMBER"}" + export default_https_port="${APACHE_HTTPS_PORT_NUMBER:-"$APACHE_DEFAULT_HTTPS_PORT_NUMBER"}" + export http_port="$default_http_port" + export https_port="$default_https_port" local var_name # Validate arguments local var_name @@ -721,7 +731,8 @@ apache_update_app_configuration() { if [[ -e "$http_vhost" ]]; then if is_file_writable "$http_vhost"; then update_common_vhost_config "$http_vhost" - # Update vhost-specific config (listen addresses) + # Update vhost-specific config (listen port and addresses) + replace_in_file "$http_vhost" "^Listen .*" "Listen ${http_port}" replace_in_file "$http_vhost" "^$" "" else warn "The ${app} virtual host file '${http_vhost}' is not writable. Configurations based on environment variables will not be applied for this file." @@ -730,7 +741,8 @@ apache_update_app_configuration() { if [[ -e "$https_vhost" ]]; then if is_file_writable "$https_vhost"; then update_common_vhost_config "$https_vhost" - # Update vhost-specific config (listen addresses) + # Update vhost-specific config (listen port and addresses) + replace_in_file "$https_vhost" "^Listen .*" "Listen ${https_port}" replace_in_file "$https_vhost" "^$" "" else warn "The ${app} virtual host file '${https_vhost}' is not writable. Configurations based on environment variables will not be applied for this file." diff --git a/bitnami/apache/README.md b/bitnami/apache/README.md index de89f55e9cc6..0dc6d33d0e3c 100644 --- a/bitnami/apache/README.md +++ b/bitnami/apache/README.md @@ -47,7 +47,7 @@ Non-root container images add an extra layer of security and are generally recom Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers/). -* [`2.4`, `2.4-debian-10`, `2.4.51`, `2.4.51-debian-10-r31`, `latest` (2.4/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-apache/blob/2.4.51-debian-10-r31/2.4/debian-10/Dockerfile) +* [`2.4`, `2.4-debian-10`, `2.4.51`, `2.4.51-debian-10-r32`, `latest` (2.4/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-apache/blob/2.4.51-debian-10-r32/2.4/debian-10/Dockerfile) Subscribe to project updates by watching the [bitnami/apache GitHub repo](https://github.com/bitnami/bitnami-docker-apache).