php+fpm+apache

1.下载Apache

docker pull httpd:2.4-alphinephp

2.下载PHP-fpm

docker pull php: 7.3.1-fpm-alpine3.8web

 3.php+fpm+apache

  1. 映射一个apache配置文件,去官网看configuration /usr/local/apache2/conf/httpd.confdocker

  2. 拷贝到本地 docker cp myweb:/usr/local/apache2/conf/httpd.conf .apache

  3. 修改本地Apache配置文件ui

    1.去除三个地方的注释(mod_proxy.so,/mod_proxy_http.so , modules/mod_proxy_fcgi.so )

    2.干掉默认配置

    拷贝代码
<VirtualHost *:8087>
    ServerAdmin ceshi.com   
    DocumentRoot "/usr/local/apache2/htdocs"
    ServerName localhost
    <Directory "/usr/local/apache2/htdocs">
     Options None
     Require all granted
    </Directory>
    ProxyRequests Off
    ProxyPassMatch ^/(.*\.php)$ fcgi://172.17.0.2:9000/php/$1
</VirtualHost>

注意这段 ProxyPassMatch ^/(.*\.php)$ fcgi://172.17.0.2:9000/php/$13d

1.查看默认配置code

2.查看到fpm容器端口 blog

相关文章
相关标签/搜索
本站公众号
   欢迎关注本站公众号,获取更多信息