Description
Environment:
- Amazon Elastic Container Service using EC2 (not Fargate)
- Container configured to use Application Load balancer
When trying to use php:7.2-apache (via mediawiki derived image) it immediately fails with caught SIGWINCH, shutting down gracefully
when added to the load balancer or on first health check. No access requests ever appear in the log so I suspect the issue might happen prior to the initial health check-- plus I can simulate the health check when not connected to the load balancer and everything is fine.
When I run a container using the same Task Definition not connected to a load balancer it works fine.
In this environment using docker run -d ...
to run in daemon mode is not an option.
Is there another way to start apache2
which will not run in the foreground and eliminate this error?
This is what's in the logs (via docker logs <<id>>
)
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Fri Sep 13 15:29:05.496367 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.2.22 configured -- resuming normal operations
[Fri Sep 13 15:29:05.497503 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
[Fri Sep 13 15:31:40.422800 2019] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully
Sometimes the logs are completely empty. There is never any access request logged suggesting that the issue happens before the initial health check or as part of handling the health check before logging it.
NOTE: I'm using this environment because 1) the application load balancer terminates SSL, 2) it's organizationally efficient/consistent from an ops perspective to have everything dockerized and running in ECS via EC2 or Fargate.