Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

2.5K
Vistas
How to enable mod_rewrite module for docker official httpd image?

I am running a LAMP stack in docker with the help from docker-compose, and for the webserver I am using the official image from https://hub.docker.com/_/httpd. The httpd container is created by a Dockerfile:

ARG APACHE_VERSION
FROM httpd:$APACHE_VERSION
RUN apt-get update;\apt-get upgrade;\a2enmod rewrite
COPY demo.apache.conf /usr/local/apache2/conf/demo.apache.conf
RUN echo "Include /usr/local/apache2/conf/demo.apache.conf" \
    >> /usr/local/apache2/conf/httpd.conf

I am trying to enable mod_rewrite with the \a2enmod rewrite command but I get the following error during build:

/bin/sh: 1: a2enmod: not found
ERROR: Service 'apache' failed to build: The command '/bin/sh -c apt-get update;\apt-get upgrade;\a2enmod rewrite' returned a non-zero code: 127

a2enmod is failing – from my reading it's only available in a debian system and the httpd base image doesn't have it.

How can I enable mod_rewrite module for this docker official httpd image during build?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I ended up figuring it out. I had to enable the module in the apache .conf file by adding the line:

LoadModule rewrite_module modules/mod_rewrite.so
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda