运行Apache时我有这个输出,使用:
FROM httpd:2.4
该工作室是:
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
看起来容器出现并且Apache正在运行,所以你应该能够将浏览器指向localhost或127.0.0.1,它应该显示默认页面(“It Worked!”或类似的东西)。
由于您正在运行docker容器,因此还要确保在Dockerfile中公开了端口80,并且没有阻止操作系统防火墙设置。
编辑:如果该警告信息困扰你(它困扰我),你可以添加像ServerName localhost
这样的指令到httpd.conf来修复它。