Enable mod_info to allow viewing configuration
In case of issues with the apache-git-http-backend it would be useful
to check the configuration that is being used at runtime. This
functionality is provided by the mod_info module.
This change activates mod_info and configures Apache to expose the
configuration on the /server-info route. This route can only be
accessed from localhost.
Change-Id: I5f25de8012cf899c399f1e7e32a79ffe6b0efac9
diff --git a/container-images/apache-git-http-backend/Dockerfile b/container-images/apache-git-http-backend/Dockerfile
index 9b3d1a0..6826f32 100644
--- a/container-images/apache-git-http-backend/Dockerfile
+++ b/container-images/apache-git-http-backend/Dockerfile
@@ -8,7 +8,8 @@
apache2-utils \
apache2-ssl \
git-daemon && \
- rm /etc/apache2/conf.d/default.conf
+ rm /etc/apache2/conf.d/default.conf && \
+ rm /etc/apache2/conf.d/info.conf
# Configure git-http-backend
COPY config/git-https-backend.conf /etc/apache2/conf.d/
diff --git a/container-images/apache-git-http-backend/config/httpd.conf b/container-images/apache-git-http-backend/config/httpd.conf
index ce11b35..0bb6241 100644
--- a/container-images/apache-git-http-backend/config/httpd.conf
+++ b/container-images/apache-git-http-backend/config/httpd.conf
@@ -163,6 +163,7 @@
#LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
#LoadModule rewrite_module modules/mod_rewrite.so
+LoadModule info_module modules/mod_info.so
LoadModule negotiation_module modules/mod_negotiation.so
@@ -443,6 +444,37 @@
#AddOutputFilter INCLUDES .shtml
</IfModule>
+<IfModule status_module>
+#
+# Allow server status reports generated by mod_status,
+# with the URL of http://servername/server-status
+# Change the ".example.com" to match your domain to enable.
+
+<Location /server-status>
+ SetHandler server-status
+ Require ip 127.0.0.1
+</Location>
+
+#
+# ExtendedStatus controls whether Apache will generate "full" status
+# information (ExtendedStatus On) or just basic information (ExtendedStatus
+# Off) when the "server-status" handler is called. The default is Off.
+#
+#ExtendedStatus On
+</IfModule>
+
+<IfModule info_module>
+#
+# Allow remote server configuration reports, with the URL of
+# http://servername/server-info (requires that mod_info.c be loaded).
+# Change the ".example.com" to match your domain to enable.
+#
+<Location /server-info>
+ SetHandler server-info
+ Require ip 127.0.0.1
+</Location>
+</IfModule>
+
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects