Skip to content

A free open source IT asset/license management system

Fixed #19913 - hide Apache version + OS from the Server response

snipea85d9de8d3d9
diff --git a/Dockerfile b/Dockerfile
index 58001863b1..012c6546a5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -79,6 +79,11 @@ RUN a2enmod rewrite
COPY docker/apache-limits.conf /etc/apache2/conf-available/limits.conf
RUN a2enconf limits
+# Suppress Apache version + OS from the Server response header and from
+# the default error-page footer.
+RUN sed -i 's/^ServerTokens.*/ServerTokens Prod/' /etc/apache2/conf-available/security.conf \
+ && sed -i 's/^ServerSignature.*/ServerSignature Off/' /etc/apache2/conf-available/security.conf
+
COPY docker/column-statistics.cnf /etc/mysql/conf.d/column-statistics.cnf
############ INITIAL APPLICATION SETUP #####################
diff --git a/Dockerfile.alpine b/Dockerfile.alpine
index 4431fca6a4..8dc2bf4756 100644
--- a/Dockerfile.alpine
+++ b/Dockerfile.alpine
@@ -53,6 +53,11 @@ COPY docker/apache-limits.conf /etc/apache2/conf.d/limits.conf
# Enable mod_rewrite
RUN sed -i '/LoadModule rewrite_module/s/^#//g' /etc/apache2/httpd.conf
+# Suppress Apache version + OS from the Server response header and from
+# the default error-page footer.
+RUN sed -i 's/^ServerTokens.*/ServerTokens Prod/' /etc/apache2/httpd.conf \
+ && sed -i 's/^ServerSignature.*/ServerSignature Off/' /etc/apache2/httpd.conf
+
COPY . /var/www/html
WORKDIR /var/www/html