Home Add mod_rewrite to Docker image httpd:alpine
Reply: 0

Add mod_rewrite to Docker image httpd:alpine

user1057 Published in April 20, 2018, 6:05 pm

I have almost no experience with Alpine Linux, to be honest, but I like its approach and therefore want to change that. I'm also relatively new to Docker, so please bear with me if this is a "stupid" question.

What I would like to achieve is building upon the httpd:alpine image and extending the HTTPd to my needs.

That would include activating the mod_rewrite module and copying a custom .htaccess into the image.

Here is what I have so far:

FROM httpd:alpine

# Copy .htaccess into DocumentRoot
COPY ./.htaccess /var/www/html/

RUN apk update
RUN apk upgrade
RUN apk add apache2-utils
RUN a2enmod rewrite
RUN rc-service apache2 restart

My issue is now, that I constantly receive an "a2enmod not found" error, which I don't know how to resolve. That might be because a2enmod is a pure Debian/Ubuntu/... thing, but I don't know any alternative way of activating mod_rewrite (or any module for that matter).

Thank you all very much in advance for your support!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306855 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO