Is there way to have configurable use of Apache (still with PHP FPM) instead of Nginx.
The thing is, there are many legacy projects that can not be easily converted to new infrastructure.
Good examples would be appreciated.
@dagrofaloyalty yes, we're going to add Apache container soon.
+1 for Apache option 馃憤
+1 for Apache + FPM
Hi guys, I had to work on a solution for having apache running soon, and this is my solution until having apache supported in docker4drupal:
https://github.com/nicobot/docker4drupal/blob/boilerplate/docker-compose.yml#L55
Maybe this helps someone else!
@condor616 what's the benefit of using apache with php via fastcgi (without mod_php)?
@csandanov currently working on a project where the prod infrastructure uses Apache + FPM.
I'm using Acquia dev desktop for now.
We need it to be able to be able to develop locally in an environment that is as close as possible to our current production environment. In other words, it is not guaranteed that things working under nginx will work when deployed under apache.
In my case, my client also uses apache + FPM, and I had to work on some redirect issues. So I wanted to verify it those were happening due to some config in the .htaccess.
ok, thank you, the apache2 image is under development, btw, what version do you guys use? 2.2 or 2.4?
We use 2.2 but it would be good to be able to switch to 2.4 as needed (2.2 hits EOL this year). Ideally you could provide both versions, as you do for php, ngingx, etc.
+1 for Apache (2.4 more important, 2.2 if possible)
Hi @csandanov... any news on that sweet apache2 image?
While waiting for an official solution, I've tried @nicobot solution but it doesn't work for me. It's really slow.
I've find out the following works better:
apache:
image: inetprocess/apache:2.4
volumes:
- docker-sync-html:/var/www/html
- ./conf/inetprocess/vhost.conf:/etc/apache2/sites-available/vhost.conf
links:
- php
environment:
APACHE_UID: 82
APACHE_GID: 82
labels:
- 'traefik.backend=docker_apache'
- 'traefik.port=80'
- 'traefik.frontend.rule=Host: mysite.local'
@condor616 weird, my team is using the apache solution I described and we're working with really good performance so far. The docker is also using apache 2.4 with fastcgi. I don't see much differences in config.
But I will also try out your suggestion, hopefully we'll get a better solution.
Thanks for posting.
Guys, has any of you managed to make .htaccess work for .php files when using apache2 + php-fpm? Not sure if apache makes sense if .htaccess files don't work. The official apache documentations says:
Warning: when you ProxyPass a request to another server (in this case, the php-fpm daemon), authentication restrictions, and other configurations placed in a Directory block or .htaccess file, may be bypassed.
@csandanov A normal .htaccess should work. But as the apache docu says, because of a proxy server (like traefik), some functions of htaccess (like directory protection) can not work respectively are bypassed.
@csandanov @cbeier I'm using the following docker image for apache inetprocess/apache:2.4 and 'm not having any issues with my .htaccess.
Here is the apache configuration entry.
FastCGIExternalServer /var/lib/php-fcgi/php-applications -host php:9000 -pass-header Authorization -idle-timeout 1200
<Directory "/var/www/docroot">
Options -Indexes +FollowSymLinks +IncludesNOEXEC -MultiViews
AllowOverride All
Require all granted
AddHandler php-applications .php
Action php-applications /php-fcgi/php-applications
</Directory>
<Directory /var/lib/php-fcgi>
Require all granted
Options FollowSymLinks
</Directory>
If there is anything you think might not work in my setup (and I've not experienced it yet), please let me know and I will test it. I'm more than happy to give it a try and let you know.
@csandanov @cbeier I didn't face any issue with .htaccess for any of our projects so far. I can also do some tests if you want to make some comparisons.
This is the image we're using: webdevops/apache-dev.
Version 2.4 is available https://github.com/wodby/drupal-apache
Now it's included the compose file in version 2.2.0 https://github.com/wodby/docker4drupal/blob/master/docker-compose.yml#L71
Most helpful comment
Version 2.4 is available https://github.com/wodby/drupal-apache