9
votes

I get this warning when i try to run my php:apache container on docker please any idea how to solve this.

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 [Mon Feb 19 14:18:21.041074 2018] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/7.0.27 configured -- resuming normal operations [Mon Feb 19 14:18:21.041534 2018] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

DOCKERFILE:

FROM php:7.0-apache
COPY . /var/www/html/
EXPOSE 80
3
Nice but how :P ??Zenzamy Othmane
If you know the exact answer please give it to me and thanks for all the informations :)Zenzamy Othmane
why give negative votes ? :/Sebastien H.

3 Answers

22
votes

Do it like you would do on a regular system:

FROM php:7.0-apache
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
COPY . /var/www/html/
EXPOSE 80

You can change the server name to suit your configuration.

11
votes

Voila thanks to aserre for the help:

FROM php:7.0-apache
COPY . /var/www/html/
EXPOSE 80
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
2
votes

If you are using Centos as base, it should look like this:

RUN echo "ServerName localhost" >> /etc/httpd/conf/httpd.conf
CMD apachectl -DFOREGROUND

regards