来自Docker映像的Apache / httpd默认配置

时间:2019-04-30 23:11:19

标签: apache httpd.conf

使用以下命令运行Apache时,输出如下:

FROM httpd:2.4

stdio是:

AH00558: httpd: 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: httpd: 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 30 23:08:14.602222 2019] [mpm_event:notice] [pid 1:tid 140596800061504] AH00489: Apache/2.4.39 (Unix) configured -- resuming normal operations
[Tue Apr 30 23:08:14.602371 2019] [core:notice] [pid 1:tid 140596800061504] AH00094: Command line: 'httpd -D FOREGROUND'

我如何在本地然后通过浏览器访问apache服务器?

这是我在其中看到的默认配置:

 /usr/local/apache2/conf/httpd.conf

https://gist.github.com/ORESoftware/27ec1911066ab4de85305dfa14bb7165

1 个答案:

答案 0 :(得分:1)

看起来容器出现了并且Apache正在运行,因此您应该能够将浏览器指向localhost或127.0.0.1,这将显示默认页面(“ It Worked!”或类似的东西)。

由于您正在运行Docker容器,还请确保在Dockerfile中公开了端口80,并且没有妨碍操作系统的防火墙设置。

编辑:如果该警告消息使您感到困扰(它使我感到困扰),则只需在httpd.conf中添加一个ServerName localhost之类的指令即可对其进行修复。