gpt4 book ai didi

php - Docker PHP-APACHE 容器全局设置 ServerName 指令

转载 作者:行者123 更新时间:2023-12-02 04:03:02 28 4
gpt4 key购买 nike

当我尝试在 docker 上运行 php:apache 容器时收到此警告,请知道如何解决此问题。

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'

Docker 文件:

FROM php:7.0-apache
COPY . /var/www/html/
EXPOSE 80

最佳答案

做吧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

您可以更改服务器名称以适合您的配置。

关于php - Docker PHP-APACHE 容器全局设置 ServerName 指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48868357/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com