1. 程式人生 > >在ubuntu最新docker映象上安裝apache2的幾個坑

在ubuntu最新docker映象上安裝apache2的幾個坑

  1. [email protected]:/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

即可解決