Home>

I tried to build apach+php development environment using ubuntu and docker environment, but it doesn't work.

I wrote the following in $HOME/phpenv/Dockfile under my home folder.

FROM php:apache
RUN echo `` >info.php

After creating a Dockerfile with the above contents, create a container image called phpapp
docker build -t phpapp.
Create container from phpapp image Port 8080 mapped to 80.
docker run -it -p 8080:80 phpapp

However, the run command fails with the following error.
The same error occurs even if the created container is deleted with the rm command and re-executed.
What could be the cause?

[email protected]:~$docker run -it -p 8080:80 phpapp
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
[Tue Apr 21 07:55:49.333727 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.4.5 configured --resuming normal operations
[Tue Apr 21 07:55:49.333813 2020] [core:notice] [pid 1] AH00094: Command line:'apache2 -D FOREGROUND'
[Tue Apr 21 07:56:12.626826 2020] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully

  • Answer # 1

    After searching the net, I found that setting ServerName in httpd.conf solved the problem.
    https://salumarine.com/how-to-fix-fqdn-warning-on-httpd/