Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please enable mod_rewrite #377

Closed
babatundebusari opened this issue Feb 21, 2017 · 11 comments
Closed

Please enable mod_rewrite #377

babatundebusari opened this issue Feb 21, 2017 · 11 comments

Comments

@babatundebusari
Copy link

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

@hairmare
Copy link

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.

@sveneh
Copy link

sveneh commented Feb 23, 2017

Just in case you need mod rewrite, create a simple Dockerfile with this content

FROM php:apache
RUN a2enmod rewrite

@babatundebusari
Copy link
Author

@sveneh

i know how to do that
my request is to OFFICIALLY support it

@yosifkit
Copy link
Member

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

@bittner
Copy link

bittner commented Mar 19, 2017

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.

@hairmare
Copy link

hairmare commented Mar 19, 2017

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

@bittner
Copy link

bittner commented Mar 19, 2017

I'm really trying to address common questions that pop up again and again, hence literally a FAQ section.

@babatundebusari
Copy link
Author

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

@bittner
Copy link

bittner commented Mar 19, 2017

@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.

@neohunter
Copy link

lets add this to the README ? :)

@docker-library docker-library deleted a comment from stufently Jan 3, 2018
@Hubbitus
Copy link

Hubbitus commented Dec 5, 2019

Why not just provide environment variable, read modules and enable them in entrypoint script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants