This repository was archived by the owner on Jul 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +65
-0
lines changed
fixture/apache/var/www/public_html Expand file tree Collapse file tree 5 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ Summary of release changes.
1919- Adds ` /docs ` directory for supplementary documentation and simplify README.
2020- Adds drop-in configuration for ` /server-satus ` ; removes from global Apache configuration.
2121- Fixes validation failure of 0 second --timeout value in ` test/health_status ` .
22+ - Fixes unintentional override of default ` DirectoryIndex ` in main Apache configuration.
2223
2324### 1.13.2 - 2019-08-05
2425
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ ADD src /
4444# - Limit threads for the application user
4545# - Disable Apache directory indexes and welcome page
4646# - Disable Apache language based content negotiation
47+ # - Prevent unintentional override of default DirectoryIndex
4748# - Custom Apache configuration
4849# - Disable all Apache modules and enable the minimum
4950# - Disable Apache default fcgid configuration; replaced with 00-fcgid.conf
@@ -89,6 +90,7 @@ RUN useradd -r -M -d /var/www/app -s /sbin/nologin app \
8990 -e 's~^LanguagePriority \( .*\) $~#LanguagePriority \1 ~g' \
9091 -e 's~^ForceLanguagePriority \( .*\) $~#ForceLanguagePriority \1 ~g' \
9192 -e 's~^AddLanguage \( .*\) $~#AddLanguage \1 ~g' \
93+ -e '/^Include conf.d\/\* .conf/i DirectoryIndex index.html index.html.var' \
9294 /etc/httpd/conf/httpd.conf \
9395 && { printf -- \
9496 '\n %s\n %s\n %s\n %s\\\n %s%s\\\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n ' \
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < title > {{TITLE}}</ title >
5+ </ head >
6+ < body >
7+ {{BODY}}
8+ </ body >
9+ </ html >
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ <html>
3+ <head>
4+ <title>{{TITLE}}</title>
5+ <meta name="php_version" content="<?php echo PHP_VERSION ?> ">
6+ </head>
7+ <body>
8+ {{BODY}}
9+ </body>
10+ </html>
Original file line number Diff line number Diff line change @@ -180,6 +180,7 @@ function test_basic_operations ()
180180 - setenvif_module
181181 - status_module
182182 - version_module"
183+ local -r content_index_html=" $( < test/fixture/apache/var/www/public_html/index.html) "
183184 local -r required_apache_modules="
184185authz_user_module
185186log_config_module
@@ -656,6 +657,48 @@ ${other_required_apache_modules}
656657 end
657658 end
658659
660+ describe " Apache DirectoryIndex"
661+ it " Defaults to index.html"
662+ __terminate_container \
663+ apache-php.1 \
664+ & > /dev/null
665+
666+ docker run \
667+ --detach \
668+ --no-healthcheck \
669+ --name apache-php.1 \
670+ --publish ${DOCKER_PORT_MAP_TCP_80} :80 \
671+ --volume ${PWD} /test/fixture/apache/var/www/public_html:/opt/app/public_html:ro \
672+ jdeathe/centos-ssh-apache-php-fcgi:latest \
673+ & > /dev/null
674+
675+ if ! __is_container_ready \
676+ apache-php.1 \
677+ ${STARTUP_TIME} \
678+ " /usr/sbin/httpd(\.worker|\.event)? " \
679+ " [[ 000 != \$ (curl -sI -o /dev/null -w %{http_code} localhost/) ]]"
680+ then
681+ exit 1
682+ fi
683+
684+ container_hostname=" $(
685+ docker exec \
686+ apache-php.1 \
687+ hostname
688+ ) "
689+
690+ curl_get_request=" $(
691+ curl -s \
692+ --header " Host: ${container_hostname} " \
693+ http://127.0.0.1:${container_port_80} /
694+ ) "
695+
696+ assert equal \
697+ " ${curl_get_request} " \
698+ " ${content_index_html} "
699+ end
700+ end
701+
659702 __terminate_container \
660703 apache-php.1 \
661704 & > /dev/null
You can’t perform that action at this time.
0 commit comments