Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker PHP-APACHE container set the ServerName directive globally

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
like image 529
Zenzamy Othmane Avatar asked Feb 19 '18 14:02

Zenzamy Othmane


2 Answers

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.

like image 93
Aserre Avatar answered Sep 16 '22 22:09

Aserre


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"]
like image 34
Zenzamy Othmane Avatar answered Sep 18 '22 22:09

Zenzamy Othmane