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

来自docker映像的Apache/httpd默认配置,apache,httpd.conf,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 relia

在运行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

看起来容器出现了,Apache正在运行,因此您应该能够将浏览器指向localhost或127.0.0.1,它应该显示默认页面(“它工作了!”或类似内容)

由于您正在运行docker容器,还应确保Dockerfile中暴露了端口80,并且没有操作系统防火墙设置

编辑:如果该警告消息让您感到不安(它让我感到不安),您可以向httpd.conf添加一个指令,如
ServerName localhost
,来修复它