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

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息