mod_rewrite is like a very popular module and mostly needed with apache
most people will be using nginx anyways if not mostly because of mod_rewrite with apache
will be GREAT to OFFICIALLY enable mod_rewrite by default to the official image
Yes we can create own own custom image but would be BETTER if its added to official by default
Thanks
I haven't use mod_rewrite since FallbackResource from mod_dir made it really easy to just use FallbackResource /index.php and not have any complex mod_rewrite configs.
While most projects still describe how to get set up with mod_rewrite, I have yet to find one where replacing mod_rewrite with FallbackResource does not work. It looks like most developers have just been using mod_rewrite to fallback to a php script and not for any serious rewriting.
Just in case you need mod rewrite, create a simple Dockerfile with this content
FROM php:apache
RUN a2enmod rewrite
@sveneh
i know how to do that
my request is to OFFICIALLY support it
We don't support any non-default mods being on by default. We'd rather not turn on extra mods that might not be used. We swap mpm_event for mpm_prefork for performance (dockerfile). The supported way is to run a2enmod on the mods you want turned on. If you are opposed to making a Dockerfile with those enabled, you can just run some shell on start that will enable them:
$ docker run -d --name apache-rewrite php:7-apache sh -c 'a2enmod rewrite && exec docker-php-entrypoint apache2-foreground'
$ docker exec -it apache-rewrite bash
root@5f9d9d912c6a:/var/www/html# ls /etc/apache2/mods-enabled/ | grep rewrite
rewrite.load
As these kind of questions pop up again and again, it may make sense to add a FAQ section to the README with links to articles that describe "how do it the right way" approaches (kind of "before vs. after"). Alternatively, they could simply link directly to appropriate answers in GitHub issues like this one.
Like this? https://github.com/docker-library/docs/tree/master/php#how-to-install-more-php-extensions 馃槥
edit: that one only covers php exts, this is about apache
I'm really trying to address common questions that pop up again and again, hence literally a FAQ section.
after deliberating for a while, i think it is true to only leave default stuffs on and any additional stuffs should be bundled with a custom image
So i agree with that logic
@babatundebusari As you write yourself, mod_rewrite is very popular and widespread use is common (Wordpress, Joomla!, et al.). Therefore, it's likely that this very question will pop up again. I think it would make sense to address this problem to avoid the question being asked again and again.
lets add this to the README ? :)
Why not just provide environment variable, read modules and enable them in entrypoint script?
Most helpful comment
Just in case you need mod rewrite, create a simple Dockerfile with this content