docker-lamp
docker-lamp copied to clipboard
000-default.conf + htaccess, rewrite
Not sure if this to be an issue or just a configuration, however, in order for the server to honour the .htaccess
file within the /app
(or server root) directory I had to edit the 000-default.conf
file found in /etc/apache2/sites-available/000-default.conf
specifically the <Directory ...
tag for the DocumentRoot. Just to add this is when using an OctoberCMS installation.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/>
...
I don't know why but your suggestion did solve the problem.
:+1: I've had the same Issue, your tip solved it !
(tag latest-1804
)
The .htaccess file was not processed at all without this manual edit.
This debug process helped, also : https://stackoverflow.com/a/9234323
Yes, it happens to me too
When migrating to another machine my .htaccess suddenly stop working. I add /var/www at Directory tag as suggested and voila ... my web running again
Thanks for the tip ... hit this, too, and the Directory
change did the trick. I'm using the mattrayner/lamp:latest-1804-php7
Docker image.
For anyone else looking, you can probably do this neatly on startup with your Dockerfile:
FROM mattrayner/lamp:latest-1804-php7
CMD ["/run.sh"]
# See https://github.com/mattrayner/docker-lamp/issues/124
RUN ["sed", "-i", "s/<Directory \\/>/<Directory \\/var\\/www\\/>/g", "/etc/apache2/sites-available/000-default.conf"]
RUN ["apachectl", "graceful"]
Yes <Directory />
caused problems at my setup too