在ubuntu最新docker镜像上安装apache2的几个坑

  1. root@31f62c83ce1e:/app# exec apache2 -D FOREGROUND
    apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot

在Dockerfile中指定了
ENV APACHE_RUN_DIR /var/run/apache2

手动建立此文件夹即解决问题

  1. AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 172.17.0.24. Set the ‘ServerName’ directive globally to suppress this message

运行:
sed -i ‘s/#ServerName www.example.com:80/ServerName localhost:80/g’ /usr/local/apache2/conf/httpd.conf

即可解决

猜你喜欢

转载自blog.csdn.net/weixin_43935079/article/details/85718404
今日推荐