简体   繁体   中英

Enable mod_gzip in docker apache httpd alpine

I've setup a httpd with docker:

FROM httpd:2.4-alpine

# load required modules (unfortunately gzip is not available)
RUN sed -i '/LoadModule rewrite_module/s/^#//g' /usr/local/apache2/conf/httpd.conf
RUN sed -i '/LoadModule deflate_module/s/^#//g' /usr/local/apache2/conf/httpd.conf

# AllowOverride All so that custom .htaccess is applied
RUN sed -i 's#AllowOverride [Nn]one#AllowOverride All#' /usr/local/apache2/conf/httpd.conf

Runs fine, but i need the mod_gzip module enabled which is not listed in httpd.conf

What i need to do in order to get the mod_gzip enabled in official docker httpd:2.4-alpine image?

Seems like mod_gzip is obsolete for apache 2.4 and mod_deflate is the way to go for doing the compression.

mod_deflate is integrated in the default apache package and just have to be enabled, mod_gzip remained external extension module and the integration is complex

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM