Open web-assistant opened 4 years ago
How does your httpd.conf
look like?
I guess, it should contain the following line like in the example:
https://github.com/lando/lando/blob/3802a60012fa1938ff3cf2f647c4ad7e1baf72a1/examples/apache/config/httpd.conf#L455
EDIT: I see you took them from the services. Could be a bug in the config - but I've never use that feature before.
@rabauss I changed the httpd.conf
to the one in the link you provided but still get the same issue. The docs say that the override should work with the httpd.conf
shipped with Lando, though if I have the .htaccess-lando
file with no custom httpd.conf
it still doesn't work. I'm rebuilding Lando each time.
Yes, this is not working for me either. Looking at the /etc/apache2/apache2.conf
inside the container it doesn't have .htaccess-lando on it
Hi everyone! While the experts figure this out (I wish I could help, but actually I know very little of about the subject) I have a temporal fix for anyone who might need this right away. I was inspired by the issue that enabled this feature to begin with, I tried actually applying their code and it didn't work for me.
This variation of their code did, though:
if [ -e /etc/apache2/apache2.conf ]; then
if ! grep -e 'AccessFileName .htaccess-lando .htaccess' /etc/apache2/apache2.conf >/dev/null; then
# force apache to use the .htaccess-lando file
eval "sed -i 's/AccessFileName .htaccess/AccessFileName .htaccess-lando/g' /etc/apache2/apache2.conf"
fi
fi
I'm replacing the line in my Apache service that calls my client's .htaccess and calling the file .htaccess-lando instead. I know this is just temporary, until someone fixes this for real, but in took me a few hours to get this working and I thought I could spare them for someone else.
Just remember to add this code to a script, and call it from your .lando.yml file at the services key like this:
[...]
services:
myservice:
build_as_root:
cmd: /path/temporal_apache_patch.sh
[...]
Keep being awesome!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.
When will this hotfix be implemented natively?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.
...and this is still totally an issue. Taking a look at this after some folks mentioned it on Slack.
Ok, so in some ways the "root issue" here is one of documentation.
The Lando Apache service accepts a .htaccess-lando
file just fine, but virtually no one uses the standalone Lando Apache service. Typically Lando users are using a WordPress/Drupal recipe that leverages Lando's PHP service, and that service actually uses different Dockerfiles to generate the Apache server, which do not make the changes to httpd.conf
necessary to read the .htaccess-lando
file.
That said, I think we've had enough consistent interest/confusion in this feature that it should be added to the PHP service.
I'm moving this ticket to the lando/php project, steps for implementation are to...
httpd.conf
with the line AccessFileName .htaccess-lando .htaccess
/etc/apache2/apache2.conf
)...also noting that when we re-do the PHP service, we should have it consume the Lando Apache service.
Thanks @anacolautti for documenting the workaround. It works a treat.
I'm trying to override the .htaccess file as instructed in https://docs.lando.dev/config/apache.html#configuration. Adding .htaccess-lando next to the Drupal root .htaccess file doesn't do anything. I have tried rebuilding and also tried adding the custom httpd.conf file taken from https://github.com/lando/lando/tree/master/plugins/lando-services/services/apache. Any ideas how I can get this working?
Running Lando v3.0.3 on Windows 10.