docker - apache2:无法可靠地确定服务器的完全限定域名,使用 172.17.0.2。
问题描述
我正在尝试在 docker 文件上的 ubuntu18.04 上配置 apache2。
我收到以下错误:
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
我知道这是一个警告,但是当我以交互方式运行图像时。我收到此消息,除此之外没有什么。我无法使用图像终端。
这里的问题 apache 没有找到“ServerName”。我试图在我的 docker 文件中覆盖它(目的只是拥有一台带有 apache 的 ubuntu 机器)
FROM ubuntu:18.04
RUN echo "welcome to yellow pages"
RUN apt-get update
RUN apt-get install -y tzdata
RUN apt-get install -y apache2
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_RUN_DIR /var/run/apache2
RUN mkdir -p ${APACHE_RUN_DIR}
ENV APACHE_PID_FILE /var/run/apache2/apache2.pid
RUN touch /etc/apache2/sites-available/yellowpages.conf
RUN echo '<VirtualHost *:80> \n\
ServerName myserver.mydomain.com \n\
ServerAdmin webmaster@localhost \n\
DocumentRoot /var/www/html \n\
ErrorLog ${APACHE_LOG_DIR}/error.log \n\
CustomLog ${APACHE_LOG_DIR}/access.log combined \n\
</VirtualHost> \n'\
> /etc/apache2/sites-available/yellowpages.conf
RUN cat /etc/apache2/sites-available/yellowpages.conf
RUN a2ensite yellowpages.conf
RUN a2dissite 000-default.conf
RUN echo 'Hello, docker' > /var/www/index.html
ENTRYPOINT ["/usr/sbin/apache2"]
CMD ["-D", "FOREGROUND"]
谁能帮我绕过这个 apache2 错误?
解决方案
推荐阅读
- node.js - 许多下载请求最终返回 403:dailyLimitExceededUnreg
- salesforce - 如何在 Postman 上使用 Salesforce Tooling API 将 SOQL 编写为 GET 方法?
- vue.js - 使用 NuxtLink 或 RouterLink 时加载栏不显示
- python - 如何使用ai检测真脸和假脸之间的区别
- swift - Uitextfield通知xcode 12
- python - Odoo:动态域过滤结果仅一次
- css - 为什么显示弹性和显示网格位置不同?
- python-3.x - 2分钟后Python套接字客户端断开连接
- here-api - HERE MAPS Javascript api getboundingbox 返回 null 即使将多个标记添加到组
- reactjs - 如何在 React 中使用 css 的关键帧显示滑动侧边栏