
[code]

    FROM amazonlinux:2
    
    ENV COMPOSER_ALLOW_SUPERUSER=1
    ENV PATH=$PATH:vendor/bin
    
    RUN yum update -y \
        && yum upgrade -y \
        && yum install -y  \
          curl \
          git \
          libxml2 \
          libxml2-devel \
          httpd \
          mysql \
          gcc \
          vim \
          make
    
    RUN amazon-linux-extras install php7.2
    
    RUN yum install -y \
          php-devel \
          php-mbstring \
          php-opcache \
          php-soap \
          php-mysqlnd \
          php-pear
    
    RUN yum clean all
    
    RUN pecl install xdebug
    
    RUN mkdir -p /www
    RUN ln -s /www/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx /etc/httpd/conf.d/
    RUN ln -s /www/xxxxxxxxxxxxxxxx/config/xdebug.ini /etc/php.d/
    
    EXPOSE 80
    CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]
    
[/code]

以上のDockerfileを記述し、buildは成功  
docker run後 以下のようなエラーが出ます

/var/log/httpd/error_log

[code]

    [suexec:notice] [pid 1] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
    [lbmethod_heartbeat:notice] [pid 1] AH02282: No slotmem from mod_heartmonitor
    [http2:warn] [pid 1] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
    [http2:warn] [pid 1] AH02951: mod_ssl does not seem to be enabled
    [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.33 () configured -- resuming normal operations
    [core:notice] [pid 1] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
    
[/code]

アクセスログ

[code]

    [proxy:error] [pid 7] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php-fpm/www.sock (*) failed
    [proxy_fcgi:error] [pid 7] [client 172.17.0.1:34136] AH01079: failed to make connection to backend: httpd-UDS
    172.17.0.1 - - [19/Jul/2018:08:59:29 +0000] "GET / HTTP/1.1" 503 299
    [proxy:error] [pid 6] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php-fpm/www.sock (*) failed
    [proxy_fcgi:error] [pid 6] [client 172.17.0.1:34138] AH01079: failed to make connection to backend: httpd-UDS, referer: http://localhost:8890/
    
[/code]

ブラウザ画面（`http://localhost:8890/`）

[code]

    Service Unavailable
    The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
    
[/code]

エラーが出てhttpdがうまく動作しません


CC BY-SA 4.0
2018-07-19T09:25:49.997
46727
2019-04-02T22:00:46.850
2018-07-25T02:21:50.287
19110
24128
question
php apache docker amazon-linux
amazon-linux2でエラーAH02454やAH01079などが出てhttpdがうまく起動しません


Docker build の前に、まずは設定を確認して、httpd が起動できるようにしましょう。

  * mod_http2 を使おうとしているようですが、prefork MPM では利用できません。worker または event を検討ください。
  * mod_ssl がインストールされていないようです。
  * fcgi で php-fpm に繋ごうとしているようですが、php-fpm プロセスが起動していないか、ソケットのパスが合っていないようです。httpd ならば php-fpm を使わずにモジュールでいいのではないでしょうか？


CC BY-SA 4.0
2018-07-20T03:30:45.697
46757
2018-07-20T03:30:45.697
4603
46727
answer